]> Nishi Git Mirror - gwion.git/commitdiff
:bug: Fix object.template_func()
authorfennecdjay <astor.jeremie@wanadoo.fr>
Thu, 25 Apr 2019 10:38:10 +0000 (12:38 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Thu, 25 Apr 2019 10:38:10 +0000 (12:38 +0200)
src/emit/emit.c
src/lib/instr.c

index a90554e8b22d0260f022fc1d911c14bd9f809231..13e4d177a3ea50670ec10b2a00e22c4037ae4eae 100644 (file)
@@ -632,7 +632,6 @@ ANN static m_bool emit_exp_decl(const Emitter emit, const Exp_Decl* decl) { GWDE
   const m_bool global = GET_FLAG(decl->td, global);
   const m_uint scope = !global ? emit->env->scope->depth : emit_push_global(emit);
   do {
-puts(s_name(list->self->xid));
     const uint r = (uint)(GET_FLAG(list->self->value, ref) + ref);
 //    if(!GET_FLAG(list->self->value, used))
 //      continue;
@@ -1612,7 +1611,7 @@ ANN static m_bool emit_exp_dot(const Emitter emit, const Exp_Dot* member) { GWDE
   if(is_special(member->t_base) > 0)
     return emit_exp_dot_special(emit, member);
   const Value value = find_value(actual_type(member->t_base), member->xid);
-  if(isa(member->t_base, t_class) < 0 && (GET_FLAG(value, member) || 
+  if(isa(member->t_base, t_class) < 0 && (GET_FLAG(value, member) ||
 (isa(exp_self(member)->type, t_function) > 0 && isa(exp_self(member)->type, t_fptr) < 0))
 ) {
     CHECK_BB(emit_exp(emit, member->base, 0))
index 53420788d99aa4a50474bf23d82ab92238a2771c..6faec1d3ca49dd46cbee065ec1eead0c7fe65aa4 100644 (file)
@@ -95,6 +95,8 @@ INSTR(DotTmpl) {
         if(traverse_dot_tmpl(emit, dt) < 0)
           continue;
       }
+      if(GET_FLAG(f->def, static))
+        shred->reg -= SZ_INT;
       *(VM_Code*)shred->reg = f->code;
       shred->reg += SZ_INT;
       return;
@@ -105,6 +107,8 @@ INSTR(DotTmpl) {
       dt->def = def; //
       dt->owner = t; //
       if(traverse_dot_tmpl(emit, dt) > 0) {
+        if(GET_FLAG(f->def, static))
+          shred->reg -= SZ_INT;
         *(VM_Code*)shred->reg = def->base->func->code;
         shred->reg += SZ_INT;
         return;