In c++ the signedness of char can be implementation dependent. Unfortunately, this caused the incorrect handling of Unicode characters in JavaScriptCore on ARM, since the code in stringFromUTF8 in jsc.cpp (http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/jsc.cpp#L658) assumes that char is signed, but that was not the case on ARM.
Created attachment 235676 [details] Patch Force GCC to use signed char for char
Comment on attachment 235676 [details] Patch I think the better fix is to make change stringFromUTF() in jsc.cpp to explicitly use a signed char since it is dependent on signed behavior for correctness. This ensures that the code is correct independent of build configurations. Are there other places where you’ve found the “sign”-ness of chars to be an issue?
Comment on attachment 235676 [details] Patch I think this change is OK, but I also think we should fix the code to not depend on char being signed. I don’t think we need to change the type to “signed char” — we can and should just remove the dependency.
Let me go further. We should remove the silly optimization in stringFromUTF. If we need a fast case for ASCII, that should be inside the fromUTF8WithLatin1Fallback function, not in the JSC tool. Please submit a patch that deletes the misguided “fast case” code from jsc.cpp.
Created attachment 236100 [details] Patch Removed fast case, as suggested.
Comment on attachment 236100 [details] Patch Clearing flags on attachment: 236100 Committed r172152: <http://trac.webkit.org/changeset/172152>
All reviewed patches have been landed. Closing bug.