From 507f99bb06664c0d6e4c408db0d2c0f2640979b7 Mon Sep 17 00:00:00 2001 From: TooManyLimits <83429328+TooManyLimits@users.noreply.github.com> Date: Tue, 3 Sep 2024 22:19:41 -0700 Subject: [PATCH] fix cursed string caching bug w/ AST builder --- .../org/figuramc/figura/parsers/LuaScriptBuilderVisitor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/org/figuramc/figura/parsers/LuaScriptBuilderVisitor.java b/common/src/main/java/org/figuramc/figura/parsers/LuaScriptBuilderVisitor.java index f7d7cc21a..0a0cc7c54 100644 --- a/common/src/main/java/org/figuramc/figura/parsers/LuaScriptBuilderVisitor.java +++ b/common/src/main/java/org/figuramc/figura/parsers/LuaScriptBuilderVisitor.java @@ -294,7 +294,7 @@ public void visit(Exp.BinopExp exp) { public void visit(Exp.Constant exp) { LuaValue value = exp.value; if (value instanceof LuaString str) { - String input = new String(str.m_bytes, StandardCharsets.UTF_8); + String input = new String(str.m_bytes, str.m_offset, str.m_length, StandardCharsets.UTF_8); int sdq = 0; for (char c : input.toCharArray()) { if (c == '\'') sdq--;