On Fri Sep 06 02:46:29 2013, ANDK wrote:
Show quoted text
I encountered similar errors during `make test` and after some debugging of Undump.xs, was able to come up with a fix (see attached patch.)
So far it is now working as expected in my own tests as well as `make test`, tested on both a Linux and Win32 systems.
Feed back is very welcome!
Happy New Year.
--- Undump.xs.orig 2013-08-22 09:51:50.000000000 -0700
+++ Undump.xs.bay-max 2018-01-03 14:35:27.000000000 -0800
@@ -897,53 +897,10 @@
if (WANT_KEY(fs)) {
DONE_KEY_SIMPLE_break;
}
- ch= ps_parse_ptr - fs_token_start;
- if (fs_token_start[0] == '-') {
- IV iv= 0;
- if ( ch < 12) {
- fs_token_start++;
- switch (ch) {
- case 11: iv -= (*fs_token_start++ - '0') * 1000000000L;
- case 10: iv -= (*fs_token_start++ - '0') * 100000000L;
- case 9: iv -= (*fs_token_start++ - '0') * 10000000L;
- case 8: iv -= (*fs_token_start++ - '0') * 1000000L;
- case 7: iv -= (*fs_token_start++ - '0') * 100000L;
- case 6: iv -= (*fs_token_start++ - '0') * 10000L;
- case 5: iv -= (*fs_token_start++ - '0') * 1000L;
- case 4: iv -= (*fs_token_start++ - '0') * 100L;
- case 3: iv -= (*fs_token_start++ - '0') * 10L;
- case 2: iv -= (*fs_token_start++ - '0') * 1L;
- break;
- default:
- PANICf1(ps,fs,"Strange length for negative integer in switch: %d", ch);
- }
- fs_got= newSViv(iv);
- } else {
- goto MAKE_SV;
- }
- } else {
- if (ch < 11 ) {
- UV uv= 0;
- switch (ch) {
- case 10: uv += (*fs_token_start++ - '0') * 1000000000L;
- case 9: uv += (*fs_token_start++ - '0') * 100000000L;
- case 8: uv += (*fs_token_start++ - '0') * 10000000L;
- case 7: uv += (*fs_token_start++ - '0') * 1000000L;
- case 6: uv += (*fs_token_start++ - '0') * 100000L;
- case 5: uv += (*fs_token_start++ - '0') * 10000L;
- case 4: uv += (*fs_token_start++ - '0') * 1000L;
- case 3: uv += (*fs_token_start++ - '0') * 100L;
- case 2: uv += (*fs_token_start++ - '0') * 10L;
- case 1: uv += (*fs_token_start++ - '0') * 1L;
- break;
- default:
- PANICf1(ps,fs,"Strange length for integer in switch: %d", ch);
- }
- fs_got= newSVuv(uv);
- } else {
- goto MAKE_SV;
- }
- }
+
+ fs_got= newSVpvn(fs_token_start, ps_parse_ptr - fs_token_start);
+ fs_got= newSViv(SvIV(fs_got));
+
goto GOT_SV;
}
case TOKEN_NV: