Skip to content

Commit 7bb6661

Browse files
committed
Sync YueScript compiler updates
1 parent b24f516 commit 7bb6661

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/yuescript/yue_compiler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static std::unordered_set<std::string> Metamethods = {
7878
"close"s // Lua 5.4
7979
};
8080

81-
const std::string_view version = "0.34.0"sv;
81+
const std::string_view version = "0.34.1"sv;
8282
const std::string_view extension = "yue"sv;
8383

8484
class CompileError : public std::logic_error {
@@ -4786,7 +4786,7 @@ class YueCompilerImpl {
47864786
auto newBlock = funLit->new_ptr<Block_t>();
47874787
if (funLit->body) {
47884788
auto last = lastStatementFrom(funLit->body);
4789-
if (!last->appendix && last->content.is<Return_t>() && !funLit->defaultReturn.is<DefaultValue_t>()) {
4789+
if (last && !last->appendix && last->content.is<Return_t>() && !funLit->defaultReturn.is<DefaultValue_t>()) {
47904790
throw CompileError("duplicated return statement", last->content);
47914791
}
47924792
auto content = funLit->body->content.get();

0 commit comments

Comments
 (0)