Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
PostIncrement needs to handle undefined values
  • Loading branch information
sorear committed Nov 21, 2010
1 parent e22b4f7 commit d8d4ab9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Builtins.cs
Expand Up @@ -15,7 +15,8 @@ public class Builtins {

public static Variable PostIncrement(Variable v) {
IP6 o1 = v.Fetch();
double d = o1.mo.mro_raw_Numeric.Get(v);
double d = o1.mo.mro_raw_defined.Get(v) ?
o1.mo.mro_raw_Numeric.Get(v) : 0;
v.Store(Kernel.BoxRaw(d + 1, Kernel.NumMO));
return Kernel.NewROScalar(o1);
}
Expand Down

0 comments on commit d8d4ab9

Please sign in to comment.