Branch: Tag:

2006-03-02

2006-03-02 10:37:58 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fix for the bug noted in LysLysKOM 14180500, where reused local variables weren't cleared properly.

Rev: src/docode.c:1.70
Rev: src/language.yacc:1.187
Rev: src/las.c:1.181

5:   \*/   /**/   #include "global.h" - RCSID("$Id: docode.c,v 1.69 2003/09/19 13:54:25 grubba Exp $"); + RCSID("$Id: docode.c,v 1.70 2006/03/02 10:37:58 grubba Exp $");   #include "las.h"   #include "program.h"   #include "language.h"
437:       if(CDR(n)->u.integer.b) goto normal_assign;    +  if (CDR(n)->node_info & OPT_ASSIGNMENT) { +  /* Initialize. */ +  emit0(F_CONST0); +  emit1(F_ASSIGN_LOCAL_AND_POP, CDR(n)->u.integer.a); +  }    code_expression(CAR(n), 0, "RHS");    emit(flags & DO_POP ? F_ASSIGN_LOCAL_AND_POP:F_ASSIGN_LOCAL,    CDR(n)->u.integer.a );
1268:    }else{    if(flags & WANT_LVALUE)    { +  if (n->node_info & OPT_ASSIGNMENT) { +  /* Initialize the variable. */ +  emit0(F_CONST0); +  emit1(F_ASSIGN_LOCAL_AND_POP, n->u.integer.a); +  }    emit(F_LOCAL_LVALUE,n->u.id.number);    return 2;    }else{ -  emit(F_LOCAL,n->u.id.number); +  if (n->node_info & OPT_ASSIGNMENT) { +  /* Initialize the variable. */ +  emit0(F_CONST0); +  emit1(F_ASSIGN_LOCAL, n->u.integer.a); +  } else { +  emit1(F_LOCAL, n->u.integer.a); +  }    return 1;    }    }