You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 27, 2020. It is now read-only.
("corrupt" might be overdramatizing this a little.)
It looks like ranges are calculated by character count rather than string length, and non-ascii characters are 'wider' than length 1. This can introduce unexpected drift if you're using the parser to identify string injection points when modifying source files.
Ascii: length 36
contractA {
/// Suint x;
}
Non Ascii: length 37
contractA {
/// 𝕊uint x;
}
These two contracts produce the same range data. Not sure this can (or should?) be fixed here. A simple work-around for my case is to sanitize files before parsing.
Interesting catch. I am only copying the character ranges returned by the ANTLR parser. I just found out that there was a deprecation due to the treatment of UTF-8 in the ANTLR JS target. Can you try making this same change in src/index.js and see if it fixes it?
(Originally reported at solidity-coverage 418)
("corrupt" might be overdramatizing this a little.)
It looks like ranges are calculated by character count rather than string length, and non-ascii characters are 'wider' than length 1. This can introduce unexpected drift if you're using the parser to identify string injection points when modifying source files.
Ascii: length 36
Non Ascii: length 37
These two contracts produce the same range data. Not sure this can (or should?) be fixed here. A simple work-around for my case is to sanitize files before parsing.
The issue raising this at SC involved scientific notation in a natspec comment.
The text was updated successfully, but these errors were encountered: