Skip to content

Commit

Permalink
Also cover 'instanceof' and '<=>' with non-portable-bytecodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainan committed Nov 17, 2023
1 parent c627bf1 commit 64cb196
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ static void check_for_non_portable_code (LexState *ls) {
** - We could alternatively inject Lua-versions of our standard library into files intended to be portable, but this might be a lot of work for little.
*/
static void check_for_non_portable_bytecode (LexState *ls) {
if (ls->t.token == TK_COAL || ls->t.seminfo.i == TK_COAL || ls->t.token == TK_IN) {
if (ls->t.token == TK_COAL || ls->t.seminfo.i == TK_COAL || ls->t.token == TK_IN || ls->t.token == TK_INSTANCEOF || ls->t.token == TK_SPACESHIP) {
throw_warn(ls, "non-portable operator usage", "this operator generates bytecode which is incompatible with Lua.", WT_NON_PORTABLE_BYTECODE);
return;
}
Expand Down

0 comments on commit 64cb196

Please sign in to comment.