From 0fa27c3783ce25be87e34249f4ea7a2e1be97b0d Mon Sep 17 00:00:00 2001 From: Enyby Date: Mon, 23 Sep 2019 00:39:42 +0300 Subject: [PATCH] EOZ (-1) not a space char. Fix bug with endless loop at not ended \z sequence. ``` local function lexerror (s, err) local st, msg = load('return ' .. s, '') if err ~= '' then err = err .. "'" end assert(not st and string.find(msg, "near .-" .. err)) end lexerror("'alo \\z \n\n", "") ``` --- src/core/org/luaj/vm2/compiler/LexState.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/org/luaj/vm2/compiler/LexState.java b/src/core/org/luaj/vm2/compiler/LexState.java index 58864110..1fbfd38a 100644 --- a/src/core/org/luaj/vm2/compiler/LexState.java +++ b/src/core/org/luaj/vm2/compiler/LexState.java @@ -198,7 +198,7 @@ public class LexState extends Constants { } private boolean isspace(int c) { - return (c <= ' '); + return (c >= 0 && c <= ' '); }