Skip to content

Commit d494aad

Browse files
committed
FIX: properly reseting internally used lexer's token value
Fixes: zsx#46
1 parent e396daa commit d494aad

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/core/l-scan.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,12 @@ extern REBSER *Scan_Full_Block(SCAN_STATE *scan_state, REBYTE mode_char);
12281228
Extend_Series(emitbuf, 1024);
12291229

12301230
value = BLK_TAIL(emitbuf);
1231-
SET_END(value);
1231+
CLEARS(value); // same like SET_END, but resets all fields
1232+
// At least VAL_INDEX must be reset with the command above, else
1233+
// it may contain value over VAL_TAIL and than some series may be
1234+
// recognized with zero length.
1235+
// See issue: https://github.com/zsx/r3/issues/46
1236+
12321237
// Line opt was set here. Moved to end in 3.0.
12331238

12341239
// If in a path, handle start of path /word or word//word cases:

0 commit comments

Comments
 (0)