authorgravatar for kt@connectfree.co.jpkristopher tate <kt@connectfree.co.jp> 2018-07-28 17:35:50+09:00
committergravatar for kt@connectfree.co.jpkristopher tate <kt@connectfree.co.jp> 2018-08-02 16:50:08+09:00
loga8ea2360958354ba8310c7cea388351299e72e44
treeb7e9144ce0c3522ee13bb86b4b5fc13fb4b0e97c
parentfcf53b31fc2899cba682c4c9a8cade40c6e0ab9e

src/ir.cpp: don't allow `@handle()` outside of a function;

Tracking Issue #1296 ;

1 files changed, 4 insertions(+), 0 deletions(-)

src/ir.cpp+4
......@@ -4493,6 +4493,10 @@ static IrInstruction *ir_gen_builtin_fn_call(IrBuilder *irb, Scope *scope, AstNo
44934493 case BuiltinFnIdFrameAddress:
44944494 return ir_lval_wrap(irb, scope, ir_build_frame_address(irb, scope, node), lval);
44954495 case BuiltinFnIdHandle:
4496 if (!irb->exec->fn_entry) {
4497 add_node_error(irb->codegen, node, buf_sprintf("@handle() called outside of function definition"));
4498 return irb->codegen->invalid_instruction;
4499 }
44964500 if (!is_async) {
44974501 add_node_error(irb->codegen, node, buf_sprintf("@handle() in non-async function"));
44984502 return irb->codegen->invalid_instruction;