2024-11-23 19:14 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000342mercuryBugpublic2014-06-25 16:39
Reporterjuliensf 
Assigned Tojuliensf 
PriorityurgentSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000342: string.format broken in non-C grades
DescriptionThe attached program should print "16.0"; when using the Mercury implementation of format
(i.e when using_sprintf returns false), it prints "10.0". This affects all of the non-C backends.
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0000706

juliensf (administrator)

This is derived from tests/general/float_test and appears to be the reason for the failure of that
test with non-C backends.

~0000707

juliensf (administrator)

The strings above should be "16" and "10" respectively.

~0000708

wangp (developer)

At least part of the bug can be attributed to commit b1af59cb29ac31db9fc5b3422fced505facabad1
where the replacement of string.substring was replaced by string.between incorrectly.

~0000709

juliensf (administrator)

Yes, that commit introduced an off-by-one error at string.m:4038. Fixing that fixes the problem.
I'll commit a fix after I run some further tests to see if anything else is broken.

~0000710

juliensf (administrator)

Fix committed.
+Notes

-Issue History
Date Modified Username Field Change
2014-06-24 16:03 juliensf New Issue
2014-06-24 16:03 juliensf File Added: fmt_bug.m
2014-06-24 16:05 juliensf Note Added: 0000706
2014-06-24 16:14 juliensf Note Added: 0000707
2014-06-24 16:31 wangp Note Added: 0000708
2014-06-24 16:54 juliensf Note Added: 0000709
2014-06-25 16:39 juliensf Note Added: 0000710
2014-06-25 16:39 juliensf Status new => resolved
2014-06-25 16:39 juliensf Resolution open => fixed
2014-06-25 16:39 juliensf Assigned To => juliensf
+Issue History