Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004885OCamlCamlp4public2009-10-03 11:222014-08-21 11:24
Reporteryoiwa 
Assigned Tohongboz 
PrioritynormalSeverityminorReproducibilityalways
StatusfeedbackResolutionopen 
PlatformOSOS Version
Product Version 
Target Versionafter-4.02.0Fixed in Version 
Summary0004885: Incorrect/unwanted behavior on invalid string inputs
DescriptionThere are two unwanted behaviors on the treatment of string literals in camlp4.

(1) Incomplete decimal/hexadecimal character escapes cause unspecified errors.

$ echo '"\0"' | camlp4o -impl /dev/stdin
Warning: File "/dev/stdin", line 1, characters 1-3: Illegal backslash escape in string or character (0)
Parse error:
$

(2) Other unharmful character escapes which are undefined in Caml syntax was useful for camlp4 extensions until 3.09, but now it produces a warning even when these are handled later by syntax extensions. Several useful syntax extensions depend on 3.09 behavior. To achieve both compatibility and safety, such checking is better to be implemented in parser (or output) instead of in lexer. The attached patch (against 3.12.0+dev5) implements the string constant validity checking in the parser stage, as well as fixing problem (1).
TagsNo tags attached.
Attached Filesdiff file icon camlp4-fixup.diff [^] (4,010 bytes) 2009-10-03 11:22 [Show Content]
diff file icon camlp4-fixup-rev2.diff [^] (3,520 bytes) 2009-10-05 23:29 [Show Content]

- Relationships

-  Notes
(0005129)
yoiwa (reporter)
2009-10-05 23:31

I updated the patch to solve an issue with antiquotations.
(0009916)
hongboz (developer)
2013-07-28 03:44

Hi, yoiwa, since this is a feature not used in common scenarios, would you provide some examples to justify this change? thanks

- Issue History
Date Modified Username Field Change
2009-10-03 11:22 yoiwa New Issue
2009-10-03 11:22 yoiwa Status new => assigned
2009-10-03 11:22 yoiwa Assigned To => ertai
2009-10-03 11:22 yoiwa File Added: camlp4-fixup.diff
2009-10-05 23:29 yoiwa File Added: camlp4-fixup-rev2.diff
2009-10-05 23:31 yoiwa Note Added: 0005129
2012-07-11 13:35 doligez Target Version => 4.01.0+dev
2012-07-12 11:28 doligez Assigned To ertai =>
2012-07-12 11:28 doligez Status assigned => acknowledged
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-17 17:36 doligez Target Version 4.00.1+dev => 4.00.2+dev
2013-07-10 15:51 doligez Target Version 4.00.2+dev => 4.01.0+dev
2013-07-22 03:01 hongboz Assigned To => hongboz
2013-07-28 03:42 hongboz Status acknowledged => feedback
2013-07-28 03:44 hongboz Note Added: 0009916
2013-08-12 15:50 doligez Target Version 4.01.0+dev => 4.01.1+dev
2014-05-25 20:20 doligez Target Version 4.01.1+dev => 4.02.0+dev
2014-08-21 11:24 doligez Target Version 4.02.0+dev => after-4.02.0


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker