mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-07-26 21:08:45 +08:00
2 bugs fixed:
empty string will be true in conditional expressions,but now it is false(and string that is not empty and is not numerable will be true)
foreach(var i;func(){return []}()); will cause sigsegv because codegen generates error op_pop and op_cntpop,now the counter in_foreach and in_forindex change after generating
foreach/forindex expression before block generation.
This commit is contained in:
+1
-1
@@ -284,7 +284,7 @@ inline bool nasal_vm::condition(nasal_ref val)
|
||||
{
|
||||
double num=str2num(val.str()->c_str());
|
||||
if(std::isnan(num))
|
||||
return val.str()->empty();
|
||||
return !val.str()->empty();
|
||||
return num;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user