Arrays debugged and working
git-svn-id: http://picoc.googlecode.com/svn/trunk@80 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
parent
78e0ff8bc1
commit
2e545deb6a
2
TODO
2
TODO
|
@ -10,4 +10,4 @@ TODO
|
||||||
Also:
|
Also:
|
||||||
* Do we really need OnHeap? Isn't every value on the stack anyway?
|
* Do we really need OnHeap? Isn't every value on the stack anyway?
|
||||||
* Remove Var parameter from HeapPopStack() once we're certain it all works
|
* Remove Var parameter from HeapPopStack() once we're certain it all works
|
||||||
|
* Clean up the two types of stack frame
|
||||||
|
|
2
parse.c
2
parse.c
|
@ -209,7 +209,7 @@ int ParseValue(struct ParseState *Parser, struct Value **Result, int ResultOnHea
|
||||||
ProgramFail(Parser, "illegal array index");
|
ProgramFail(Parser, "illegal array index");
|
||||||
|
|
||||||
VariableStackPop(Parser, *Result);
|
VariableStackPop(Parser, *Result);
|
||||||
LocalLValue = VariableAllocValueFromExistingData(Parser, (*Result)->Typ->FromType, (union AnyValue *)((void *)(&(*Result)->Val) + (*Result)->Typ->FromType->Sizeof * IntValue), TRUE, ResultOnHeap);
|
*Result = VariableAllocValueFromExistingData(Parser, (*Result)->Typ->FromType, (union AnyValue *)((void *)(*Result)->Val + (*Result)->Typ->FromType->Sizeof * IntValue), TRUE, ResultOnHeap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
10
picoc.h
10
picoc.h
|
@ -150,11 +150,11 @@ union AnyValue
|
||||||
|
|
||||||
struct Value
|
struct Value
|
||||||
{
|
{
|
||||||
struct ValueType *Typ;
|
struct ValueType *Typ; /* the type of this value */
|
||||||
union AnyValue *Val;
|
union AnyValue *Val; /* pointer to the AnyValue which holds the actual content */
|
||||||
char ValOnHeap;
|
char ValOnHeap; /* the AnyValue is on the heap (but this Value is on the stack) */
|
||||||
char ValOnStack;
|
char ValOnStack; /* the AnyValue is on the stack along with this Value */
|
||||||
char IsLValue;
|
char IsLValue; /* is modifiable and is allocated somewhere we can usefully modify it */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* hash table data structure */
|
/* hash table data structure */
|
||||||
|
|
Loading…
Reference in a new issue