Test fails for string_to_unicode
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=105
Reported by Andreas Lange, a.lange@home.se
This shows up in all the latest verifications in Autobuild but only for Solaris8 IA32.
One of the builds with this problem: http://community.roxen.com/developers/autobuild/build_results/reports/pike7.1-20000824183055-sunos-5.8-i86pc.verify.txt
testsuite: Test 9214 (shift 0) (CRNL) failed.
1: mixed a() { return string_to_unicode("foo"); }
2: mixed b() { return "\0f\0o\0o"; }
o->a(): "\0f\0o?o"
o->b(): "\0f\0o\0o"
testsuite: Test 9215 (shift 1) (CRNL) failed.
1: mixed a() { return string_to_unicode("blä"); }
2: mixed b() { return "\0b\0l\0ä"; }
o->a(): "\0b\0l?ä"
o->b(): "\0b\0l\0ä"
Grubba's suggestion: MEMSET fails to clear the high bit here:
---
switch(in->size_shift) {
case 0:
/* Just 8bit characters */
len = in->len * 2;
out = begin_shared_string(len);
MEMSET(out->str, 0, len); /* Clear the upper (and lower) byte */
for(i = in->len; i--;) {
out->str[i * 2 + 1] = in->str[i];
}
out = end_shared_string(out);
break;
---