Bug fix for platform variables

git-svn-id: http://picoc.googlecode.com/svn/trunk@155 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
zik.saleeba 2009-03-05 05:03:28 +00:00
parent d137fdcbeb
commit 886526f462

View file

@ -139,7 +139,8 @@ void VariableDefinePlatformVar(struct ParseState *Parser, char *Ident, struct Va
SomeValue->Val->Array.Data = FromValue;
}
VariableDefine(Parser, TableStrRegister(Ident), SomeValue);
if (!TableSet((TopStackFrame == NULL) ? &GlobalTable : &TopStackFrame->LocalTable, TableStrRegister(Ident), SomeValue))
ProgramFail(Parser, "'%s' is already defined", Ident);
}
/* free and/or pop the top value off the stack. Var must be the top value on the stack! */