Loading a binary chunk should not break assertions
Although the execution of a bad binary chunk can crash the interpreter, simply loading it should be safe.
This commit is contained in:
@@ -234,7 +234,7 @@ static void loadConstants (LoadState *S, Proto *f) {
|
|||||||
f->source = NULL;
|
f->source = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: lua_assert(0);
|
default: error(S, "invalid constant");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1402,6 +1402,9 @@ Chunks can also be precompiled into binary form;
|
|||||||
see the program @idx{luac} and the function @Lid{string.dump} for details.
|
see the program @idx{luac} and the function @Lid{string.dump} for details.
|
||||||
Programs in source and compiled forms are interchangeable;
|
Programs in source and compiled forms are interchangeable;
|
||||||
Lua automatically detects the file type and acts accordingly @seeF{load}.
|
Lua automatically detects the file type and acts accordingly @seeF{load}.
|
||||||
|
Be aware that, unlike source code,
|
||||||
|
the execution of maliciously crafted
|
||||||
|
bytecode can crash the interpreter.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user