]> Nishi Git Mirror - gwion.git/commitdiff
:bug: More edge case fixes
authorJérémie Astor <fennecdjay@gmail.com>
Wed, 22 Sep 2021 17:27:49 +0000 (19:27 +0200)
committerJérémie Astor <fennecdjay@gmail.com>
Wed, 22 Sep 2021 17:27:49 +0000 (19:27 +0200)
src/lib/object_op.c
src/parse/template.c
src/vm/vm.c

index e2353320b8b4bf3e7af567235c09d0001ef243e5..6a50adb54406ad8ccdfd4e296e60569904bbdb87 100644 (file)
@@ -144,8 +144,14 @@ ANN static void emit_member_func(const Emitter emit, const Exp_Dot *member) {
     if (!vflag(f->value_ref, vflag_member))
       instr->m_val2 = -SZ_INT;
     else {
-      const Instr instr = emit_add_instr(emit, RegMove);
-      instr->m_val      = SZ_INT;
+      if(member->is_call){
+        const Instr instr = emit_add_instr(emit, RegMove);
+        instr->m_val      = SZ_INT;
+      } else {
+        const Instr instr = (Instr)vector_back(&emit->code->instr);
+        instr->opcode = eRegPushImm;
+        instr->m_val = (m_uint)f->code;
+      }
     }
   }
   return;
index 9419af4bedd67c8c0a7db117d0d75b9c314a7a17..80e76556ecaf9600644929380e8509223d3c2f1a 100644 (file)
@@ -18,7 +18,7 @@ ANN static m_bool _push_types(const Env env, const Nspc nspc,
   Type_List        call = tmpl->call;
   do {
     if (!call) break;
-    const Type t = known_type(env, call->td);
+    const Type t = call->td ? known_type(env, call->td) : NULL;
     if (!t) return GW_OK;
     nspc_add_type(nspc, list->xid, t);
     call = call->next;
index 8cbc14d3e02de7471228dc84aae782717f892392..96ba7e920963a73adb50b05b75c5376351094592 100644 (file)
@@ -684,7 +684,7 @@ vm_run(const VM *vm) { // lgtm [cpp/use-of-goto]
     intlt:
       INT_LOGICAL(<)
     intle:
-      INT_IMM_LOGICAL(<=)
+      INT_LOGICAL(<=)
     intgtimm:
       INT_IMM_LOGICAL(>)
     intgeimm: