diff options
| author | Li Jin <dragon-fly@qq.com> | 2025-07-17 19:22:33 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2025-07-17 19:22:33 +0800 |
| commit | 828fee1907a8fd8773d304d3d9a49fc0e2f8cb84 (patch) | |
| tree | f4b82e38c793fee7141b5d8f4d326fd31bee985e /src | |
| parent | c03bf36db11bcd90034b0e67bd1f5c8c0765eb7f (diff) | |
| download | yuescript-828fee1907a8fd8773d304d3d9a49fc0e2f8cb84.tar.gz yuescript-828fee1907a8fd8773d304d3d9a49fc0e2f8cb84.tar.bz2 yuescript-828fee1907a8fd8773d304d3d9a49fc0e2f8cb84.zip | |
Fixed a crash.
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuescript/yue_compiler.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index 35d99bd..f952e9a 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp | |||
| @@ -5448,14 +5448,14 @@ private: | |||
| 5448 | if (argsDef->varArg) { | 5448 | if (argsDef->varArg) { |
| 5449 | newArgs.emplace_back(_parser.toString(argsDef->varArg)); | 5449 | newArgs.emplace_back(_parser.toString(argsDef->varArg)); |
| 5450 | } | 5450 | } |
| 5451 | } | 5451 | if (argsDef->label) { |
| 5452 | if (argsDef->label) { | 5452 | hasCheck = true; |
| 5453 | hasCheck = true; | 5453 | const auto& astName = _parser.toString(argsDef->label); |
| 5454 | const auto& astName = _parser.toString(argsDef->label); | 5454 | if (!_parser.hasAST(astName)) { |
| 5455 | if (!_parser.hasAST(astName)) { | 5455 | throw CompileError("invalid AST name"sv, argsDef->label); |
| 5456 | throw CompileError("invalid AST name"sv, argsDef->label); | 5456 | } |
| 5457 | argChecks.emplace_back("..."s + astName); | ||
| 5457 | } | 5458 | } |
| 5458 | argChecks.emplace_back("..."s + astName); | ||
| 5459 | } | 5459 | } |
| 5460 | std::string macroCodes = "_ENV=require('yue').macro_env\n("s + join(newArgs, ","sv) + ")->"s + _parser.toString(macroLit->body); | 5460 | std::string macroCodes = "_ENV=require('yue').macro_env\n("s + join(newArgs, ","sv) + ")->"s + _parser.toString(macroLit->body); |
| 5461 | auto chunkName = "=(macro "s + macroName + ')'; | 5461 | auto chunkName = "=(macro "s + macroName + ')'; |
