]> Nishi Git Mirror - gwion.git/commitdiff
:art: improve emit kind
authorfennecdjay <fennecdjay@gmail.com>
Sat, 29 Oct 2022 11:01:31 +0000 (13:01 +0200)
committerfennecdjay <fennecdjay@gmail.com>
Sat, 29 Oct 2022 11:01:31 +0000 (13:01 +0200)
src/emit/emit.c
src/emit/kind.c

index 034c49c74a12dba4d23d8b409f2af2d042487f3d..b419cb2fa3d324da0827e8d6100d1e36f1ca6374 100644 (file)
@@ -112,7 +112,7 @@ ANN static inline void frame_push(Frame *frame) {
 }
 
 static const f_instr allocmember[] = {RegPushImm, RegPushImm2, RegPushImm3,
-                                      AllocMember4};
+                                      DotMemberMem4};
 static const f_instr allocword[]   = {AllocWord, AllocWord2, AllocWord3,
                                     RegPushMem4};
 
index 0f228f5674e27cee6d8ba78f245587ed1464a9ef..404feb5270b86bac88937f896b60d48da7e37f7b 100644 (file)
@@ -16,8 +16,8 @@ static inline enum Kind kindof(const m_uint size, const uint emit_var) {
 ANN Instr emit_kind(Emitter emit, const m_uint size, const bool addr,
                     const f_instr func[]) {
   const enum Kind kind  = kindof(size, addr);
-  const Instr     instr = emit_add_instr(emit, func[kind]);
-  instr->m_val2         = size;
+  const Instr instr = emit_add_instr(emit, func[kind]);
+  if(kind == KIND_OTHER) instr->m_val2 = size;
   return instr;
 }