comparison lwasm/lwasm.c @ 275:97630727000e 2.5

fixed expression 'slots' to not store null on a pass 1 store
author lost
date Mon, 31 Aug 2009 08:37:15 +0000
parents 1106ec189e4f
children
comparison
equal deleted inserted replaced
274:3010e24bb9c5 275:97630727000e
371 int rval; 371 int rval;
372 372
373 if ((as -> passnum == 1 && !(flag & EXPR_REEVAL)) || slot < 0) 373 if ((as -> passnum == 1 && !(flag & EXPR_REEVAL)) || slot < 0)
374 { 374 {
375 s = lwasm_evaluate_expr(as, l, *inp, &ep, flag); 375 s = lwasm_evaluate_expr(as, l, *inp, &ep, flag);
376 // if (!ep)
377 // ep = *inp;
376 if (slot >= 0) 378 if (slot >= 0)
379 {
377 l -> exprs[slot] = s; 380 l -> exprs[slot] = s;
381 l -> exprends[slot] = ep;
382 }
378 if (!s) 383 if (!s)
379 { 384 {
380 register_error(as, l, 1, "Bad expression"); 385 register_error(as, l, 1, "Bad expression");
381 *val = 0; 386 *val = 0;
382 return -1; 387 return -1;
383 } 388 }
384 *inp = (char *)ep; 389 *inp = (char *)ep;
385 if (slot >= 0) 390 if (slot >= 0)
386 { 391 {
387 l -> exprends[slot] = (char *)ep; 392 // l -> exprends[slot] = (char *)ep;
388 l -> exprvals[slot] = lwasm_expr_get_value(s); 393 l -> exprvals[slot] = lwasm_expr_get_value(s);
389 } 394 }
390 } 395 }
391 else if (l -> exprs[slot]) 396 else if (l -> exprs[slot])
392 { 397 {