diff options
author | Li Jin <dragon-fly@qq.com> | 2023-12-19 14:37:28 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-12-19 14:37:28 +0800 |
commit | 8a7b5cc48c22f910a02320b547b76283307a1b83 (patch) | |
tree | a613b0f46ca55a843b40d93c3c47a2c1db1c3da9 /src | |
parent | 1b43ecc9a453e0cc7b0a481690375ca35457d54a (diff) | |
download | yuescript-8a7b5cc48c22f910a02320b547b76283307a1b83.tar.gz yuescript-8a7b5cc48c22f910a02320b547b76283307a1b83.tar.bz2 yuescript-8a7b5cc48c22f910a02320b547b76283307a1b83.zip |
fix a crash case.
Diffstat (limited to 'src')
-rw-r--r-- | src/yuescript/yue_compiler.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index 2283d85..d43f79b 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp | |||
@@ -75,7 +75,7 @@ static std::unordered_set<std::string> Metamethods = { | |||
75 | "close"s // Lua 5.4 | 75 | "close"s // Lua 5.4 |
76 | }; | 76 | }; |
77 | 77 | ||
78 | const std::string_view version = "0.21.4"sv; | 78 | const std::string_view version = "0.21.5"sv; |
79 | const std::string_view extension = "yue"sv; | 79 | const std::string_view extension = "yue"sv; |
80 | 80 | ||
81 | class CompileError : public std::logic_error { | 81 | class CompileError : public std::logic_error { |
@@ -3959,6 +3959,7 @@ private: | |||
3959 | expListAssign && expListAssign->action && expListAssign->action.is<Assign_t>()) { | 3959 | expListAssign && expListAssign->action && expListAssign->action.is<Assign_t>()) { |
3960 | BLOCK_START | 3960 | BLOCK_START |
3961 | auto unary = singleUnaryExpFrom(expListAssign->expList->exprs.back()); | 3961 | auto unary = singleUnaryExpFrom(expListAssign->expList->exprs.back()); |
3962 | BREAK_IF(!unary); | ||
3962 | BREAK_IF(!unary->ops.empty()); | 3963 | BREAK_IF(!unary->ops.empty()); |
3963 | auto value = static_cast<Value_t*>(unary->expos.front()); | 3964 | auto value = static_cast<Value_t*>(unary->expos.front()); |
3964 | auto simpleValue = value->item.as<SimpleValue_t>(); | 3965 | auto simpleValue = value->item.as<SimpleValue_t>(); |