From a65dfd2366778cb8b4add1cf2009d00b3760f9b7 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Sat, 19 Nov 2022 15:38:50 +0100 Subject: [PATCH] :art: emit.c exp_td security --- src/emit/emit.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/emit/emit.c b/src/emit/emit.c index 66e27c68..e6d50693 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1926,7 +1926,12 @@ ANN static m_bool emit_exp_lambda(const Emitter emit, ANN static m_bool emit_exp_td(const Emitter emit, Type_Decl *td) { const Type base = exp_self(td)->type; - emit_pushimm(emit, (m_uint)base); + if(!is_func(emit->gwion, base)) + emit_pushimm(emit, (m_uint)base); + else { + const Instr instr = emit_add_instr(emit, SetFunc); + instr->m_val = (m_uint)base->info->func; + } return GW_OK; } -- 2.43.0