By popular demand I'm adding support for native pointers. It's a work in progress - not working yet.
git-svn-id: http://picoc.googlecode.com/svn/trunk@277 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
parent
0acb79a9a5
commit
a76fc34881
38
clibrary.c
38
clibrary.c
|
@ -141,17 +141,22 @@ void PrintType(struct ValueType *Typ, struct OutputStream *Stream)
|
|||
/* intrinsic functions made available to the language */
|
||||
void GenericPrintf(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs, struct OutputStream *Stream)
|
||||
{
|
||||
struct Value *CharArray = Param[0]->Val->Pointer.Segment;
|
||||
char *Format;
|
||||
char *FPos;
|
||||
struct Value *NextArg = Param[0];
|
||||
struct ValueType *FormatType;
|
||||
int ArgCount = 1;
|
||||
|
||||
#ifndef NATIVE_POINTERS
|
||||
char *Format;
|
||||
struct Value *CharArray = Param[0]->Val->Pointer.Segment;
|
||||
|
||||
if (Param[0]->Val->Pointer.Offset < 0 || Param[0]->Val->Pointer.Offset >= CharArray->Val->Array.Size)
|
||||
Format = StrEmpty;
|
||||
else
|
||||
Format = CharArray->Val->Array.Data + Param[0]->Val->Pointer.Offset;
|
||||
#else
|
||||
char *Format = Param[0]->Val->NativePointer;
|
||||
// XXX - dereference this properly
|
||||
#endif
|
||||
|
||||
for (FPos = Format; *FPos != '\0'; FPos++)
|
||||
{
|
||||
|
@ -185,6 +190,7 @@ void GenericPrintf(struct ParseState *Parser, struct Value *ReturnValue, struct
|
|||
{
|
||||
case 's':
|
||||
{
|
||||
#ifndef NATIVE_POINTERS
|
||||
struct Value *CharArray = NextArg->Val->Pointer.Segment;
|
||||
char *Str;
|
||||
|
||||
|
@ -192,6 +198,10 @@ void GenericPrintf(struct ParseState *Parser, struct Value *ReturnValue, struct
|
|||
Str = StrEmpty;
|
||||
else
|
||||
Str = CharArray->Val->Array.Data + NextArg->Val->Pointer.Offset;
|
||||
#else
|
||||
char *Str = NextArg->Val->NativePointer;
|
||||
// XXX - dereference this properly
|
||||
#endif
|
||||
|
||||
PrintStr(Str, Stream);
|
||||
break;
|
||||
|
@ -239,13 +249,18 @@ void LibSPrintf(struct ParseState *Parser, struct Value *ReturnValue, struct Val
|
|||
StrStream.i.Str.MaxPos = StrStream.i.Str.WritePos- DerefOffset + DerefVal->Val->Array.Size;
|
||||
GenericPrintf(Parser, ReturnValue, Param+1, NumArgs-1, &StrStream);
|
||||
PrintCh(0, &StrStream);
|
||||
#ifndef NATIVE_POINTERS
|
||||
ReturnValue->Val->Pointer.Segment = *Param;
|
||||
ReturnValue->Val->Pointer.Offset = 0;
|
||||
#else
|
||||
ReturnValue->Val->NativePointer = *Param;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* get a line of input. protected from buffer overrun */
|
||||
void LibGets(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
|
||||
{
|
||||
#ifndef NATIVE_POINTERS
|
||||
struct Value *CharArray = Param[0]->Val->Pointer.Segment;
|
||||
char *ReadBuffer = CharArray->Val->Array.Data + Param[0]->Val->Pointer.Offset;
|
||||
int MaxLength = CharArray->Val->Array.Size - Param[0]->Val->Pointer.Offset;
|
||||
|
@ -262,6 +277,23 @@ void LibGets(struct ParseState *Parser, struct Value *ReturnValue, struct Value
|
|||
return;
|
||||
|
||||
ReturnValue->Val->Pointer = Param[0]->Val->Pointer;
|
||||
#else
|
||||
struct Value *CharArray = (struct Value *)(Param[0]->Val->NativePointer);
|
||||
char *ReadBuffer = CharArray->Val->Array.Data;
|
||||
int MaxLength = CharArray->Val->Array.Size;
|
||||
char *Result;
|
||||
|
||||
ReturnValue->Val->NativePointer = NULL;
|
||||
|
||||
if (MaxLength < 0)
|
||||
return; /* no room for data */
|
||||
|
||||
Result = PlatformGetLine(ReadBuffer, MaxLength);
|
||||
if (Result == NULL)
|
||||
return;
|
||||
|
||||
ReturnValue->Val->NativePointer = Param[0]->Val->NativePointer;
|
||||
#endif
|
||||
}
|
||||
|
||||
void LibGetc(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
|
||||
|
|
107
expression.c
107
expression.c
|
@ -228,14 +228,24 @@ struct Value *ExpressionAssignToPointer(struct ParseState *Parser, struct Value
|
|||
int DerefOffset;
|
||||
|
||||
if (FromValue->Typ == ToValue->Typ)
|
||||
{
|
||||
#ifndef NATIVE_POINTERS
|
||||
ToValue->Val->Pointer = FromValue->Val->Pointer; /* plain old pointer assignment */
|
||||
#else
|
||||
ToValue->Val->NativePointer = FromValue->Val->NativePointer; /* plain old pointer assignment */
|
||||
#endif
|
||||
}
|
||||
|
||||
else if (FromValue->Typ->Base == TypeArray && PointedToType == FromValue->Typ->FromType)
|
||||
{
|
||||
/* the form is: blah *x = array of blah */
|
||||
#ifndef NATIVE_POINTERS
|
||||
ToValue->Val->Pointer.Segment = FromValue;
|
||||
ToValue->Val->Pointer.Offset = 0;
|
||||
DerefVal = FromValue;
|
||||
#else
|
||||
ToValue->Val->NativePointer = FromValue;
|
||||
#endif
|
||||
}
|
||||
else if (FromValue->Typ->Base == TypePointer && FromValue->Typ->FromType->Base == TypeArray && PointedToType == FromValue->Typ->FromType->FromType)
|
||||
{
|
||||
|
@ -243,8 +253,12 @@ struct Value *ExpressionAssignToPointer(struct ParseState *Parser, struct Value
|
|||
struct ValueType *DerefType;
|
||||
|
||||
VariableDereferencePointer(Parser, FromValue, &DerefVal, &DerefOffset, &DerefType);
|
||||
#ifndef NATIVE_POINTERS
|
||||
ToValue->Val->Pointer.Segment = DerefVal;
|
||||
ToValue->Val->Pointer.Offset = DerefOffset;
|
||||
#else
|
||||
ToValue->Val->NativePointer = DerefVal;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
ProgramFail(Parser, "can't assign from a %t to a %t", FromValue->Typ, ToValue->Typ);
|
||||
|
@ -253,7 +267,11 @@ struct Value *ExpressionAssignToPointer(struct ParseState *Parser, struct Value
|
|||
{
|
||||
/* put a copy of the pointer on the stack */
|
||||
ValueLoc = VariableAllocValueFromType(Parser, ToValue->Typ, TRUE, NULL);
|
||||
#ifndef NATIVE_POINTERS
|
||||
ValueLoc->Val->Pointer = ToValue->Val->Pointer;
|
||||
#else
|
||||
ValueLoc->Val->NativePointer = ToValue->Val->NativePointer;
|
||||
#endif
|
||||
}
|
||||
|
||||
return ValueLoc;
|
||||
|
@ -282,10 +300,13 @@ void ExpressionPrefixOperator(struct ParseState *Parser, struct ExpressionStack
|
|||
TempLValue = TopValue->LValueFrom;
|
||||
assert(TempLValue != NULL);
|
||||
Result = VariableAllocValueFromType(Parser, TypeGetMatching(Parser, TopValue->Typ, TypePointer, 0, StrEmpty), FALSE, NULL);
|
||||
#ifndef NATIVE_POINTERS
|
||||
Result->Val->Pointer.Segment = TempLValue;
|
||||
if (Result->LValueFrom != NULL)
|
||||
Result->Val->Pointer.Offset = (void *)Result->Val - (void *)Result->LValueFrom;
|
||||
|
||||
#else
|
||||
Result->Val->NativePointer = TempLValue;
|
||||
#endif
|
||||
ExpressionStackPushValueNode(Parser, StackTop, Result);
|
||||
break;
|
||||
|
||||
|
@ -342,28 +363,46 @@ void ExpressionPrefixOperator(struct ParseState *Parser, struct ExpressionStack
|
|||
{
|
||||
/* pointer prefix arithmetic */
|
||||
int Size = TypeSize(TopValue->Typ->FromType, 0, TRUE);
|
||||
int OrigOffset = TopValue->Val->Pointer.Offset;
|
||||
struct Value *StackValue;
|
||||
|
||||
#ifndef NATIVE_POINTERS
|
||||
int OrigOffset = TopValue->Val->Pointer.Offset;
|
||||
|
||||
if (TopValue->Val->Pointer.Segment == NULL)
|
||||
ProgramFail(Parser, "invalid use of a NULL pointer");
|
||||
|
||||
|
||||
if (!TopValue->IsLValue)
|
||||
ProgramFail(Parser, "can't assign to this");
|
||||
|
||||
|
||||
switch (Op)
|
||||
{
|
||||
case TokenIncrement: TopValue->Val->Pointer.Offset += Size; break;
|
||||
case TokenDecrement: TopValue->Val->Pointer.Offset -= Size; break;
|
||||
default: ProgramFail(Parser, "invalid operation"); break;
|
||||
}
|
||||
|
||||
|
||||
/* check pointer bounds */
|
||||
if (TopValue->Val->Pointer.Offset < 0 || TopValue->Val->Pointer.Offset > TypeLastAccessibleOffset(TopValue->Val->Pointer.Segment))
|
||||
TopValue->Val->Pointer.Offset = OrigOffset;
|
||||
|
||||
|
||||
StackValue = ExpressionStackPushValueByType(Parser, StackTop, TopValue->Typ);
|
||||
StackValue->Val->Pointer = TopValue->Val->Pointer;
|
||||
#else
|
||||
if (TopValue->Val->NativePointer == NULL)
|
||||
ProgramFail(Parser, "invalid use of a NULL pointer");
|
||||
|
||||
if (!TopValue->IsLValue)
|
||||
ProgramFail(Parser, "can't assign to this");
|
||||
|
||||
switch (Op)
|
||||
{
|
||||
case TokenIncrement: TopValue->Val->NativePointer += Size; break;
|
||||
case TokenDecrement: TopValue->Val->NativePointer -= Size; break;
|
||||
default: ProgramFail(Parser, "invalid operation"); break;
|
||||
}
|
||||
|
||||
StackValue = ExpressionStackPushValueByType(Parser, StackTop, TopValue->Typ);
|
||||
StackValue->Val->NativePointer = TopValue->Val->NativePointer;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
ProgramFail(Parser, "invalid operation");
|
||||
|
@ -401,8 +440,9 @@ void ExpressionPostfixOperator(struct ParseState *Parser, struct ExpressionStack
|
|||
{
|
||||
/* pointer postfix arithmetic */
|
||||
int Size = TypeSize(TopValue->Typ->FromType, 0, TRUE);
|
||||
struct PointerValue OrigPointer = TopValue->Val->Pointer;
|
||||
struct Value *StackValue;
|
||||
#ifndef NATIVE_POINTERS
|
||||
struct PointerValue OrigPointer = TopValue->Val->Pointer;
|
||||
|
||||
if (TopValue->Val->Pointer.Segment == NULL)
|
||||
ProgramFail(Parser, "invalid use of a NULL pointer");
|
||||
|
@ -425,6 +465,25 @@ void ExpressionPostfixOperator(struct ParseState *Parser, struct ExpressionStack
|
|||
|
||||
StackValue = ExpressionStackPushValueByType(Parser, StackTop, TopValue->Typ);
|
||||
StackValue->Val->Pointer = OrigPointer;
|
||||
#else
|
||||
void *OrigPointer = TopValue->Val->NativePointer;
|
||||
|
||||
if (TopValue->Val->NativePointer == NULL)
|
||||
ProgramFail(Parser, "invalid use of a NULL pointer");
|
||||
|
||||
if (!TopValue->IsLValue)
|
||||
ProgramFail(Parser, "can't assign to this");
|
||||
|
||||
switch (Op)
|
||||
{
|
||||
case TokenIncrement: TopValue->Val->NativePointer += Size; break;
|
||||
case TokenDecrement: TopValue->Val->NativePointer -= Size; break;
|
||||
default: ProgramFail(Parser, "invalid operation"); break;
|
||||
}
|
||||
|
||||
StackValue = ExpressionStackPushValueByType(Parser, StackTop, TopValue->Typ);
|
||||
StackValue->Val->NativePointer = OrigPointer;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
ProgramFail(Parser, "invalid operation");
|
||||
|
@ -434,8 +493,12 @@ void ExpressionPostfixOperator(struct ParseState *Parser, struct ExpressionStack
|
|||
void ExpressionInfixOperator(struct ParseState *Parser, struct ExpressionStack **StackTop, enum LexToken Op, struct Value *BottomValue, struct Value *TopValue)
|
||||
{
|
||||
int ResultInt = 0;
|
||||
struct PointerValue Pointer;
|
||||
struct Value *StackValue;
|
||||
#ifndef NATIVE_POINTERS
|
||||
struct PointerValue Pointer;
|
||||
#else
|
||||
void *NativePointer;
|
||||
#endif
|
||||
|
||||
if (Parser->Mode != RunModeRun)
|
||||
{
|
||||
|
@ -561,16 +624,24 @@ void ExpressionInfixOperator(struct ParseState *Parser, struct ExpressionStack *
|
|||
if (TopInt != 0)
|
||||
ProgramFail(Parser, "invalid operation");
|
||||
|
||||
#ifndef NATIVE_POINTERS
|
||||
if (Op == TokenEqual)
|
||||
ExpressionPushInt(Parser, StackTop, BottomValue->Val->Pointer.Segment == NULL);
|
||||
else
|
||||
ExpressionPushInt(Parser, StackTop, BottomValue->Val->Pointer.Segment != NULL);
|
||||
#else
|
||||
if (Op == TokenEqual)
|
||||
ExpressionPushInt(Parser, StackTop, BottomValue->Val->NativePointer == NULL);
|
||||
else
|
||||
ExpressionPushInt(Parser, StackTop, BottomValue->Val->NativePointer != NULL);
|
||||
#endif
|
||||
}
|
||||
else if (Op == TokenPlus || Op == TokenMinus)
|
||||
{
|
||||
/* pointer arithmetic */
|
||||
int Size = TypeSize(BottomValue->Typ->FromType, 0, TRUE);
|
||||
|
||||
#ifndef NATIVE_POINTERS
|
||||
Pointer = BottomValue->Val->Pointer;
|
||||
if (Pointer.Segment == NULL)
|
||||
ProgramFail(Parser, "invalid use of a NULL pointer");
|
||||
|
@ -586,6 +657,19 @@ void ExpressionInfixOperator(struct ParseState *Parser, struct ExpressionStack *
|
|||
|
||||
StackValue = ExpressionStackPushValueByType(Parser, StackTop, BottomValue->Typ);
|
||||
StackValue->Val->Pointer = Pointer;
|
||||
#else
|
||||
NativePointer = BottomValue->Val->NativePointer;
|
||||
if (NativePointer == NULL)
|
||||
ProgramFail(Parser, "invalid use of a NULL pointer");
|
||||
|
||||
if (Op == TokenPlus)
|
||||
NativePointer += TopInt * Size;
|
||||
else
|
||||
NativePointer -= TopInt * Size;
|
||||
|
||||
StackValue = ExpressionStackPushValueByType(Parser, StackTop, BottomValue->Typ);
|
||||
StackValue->Val->NativePointer = NativePointer;
|
||||
#endif
|
||||
}
|
||||
else if (Op == TokenAssign && TopInt == 0)
|
||||
{
|
||||
|
@ -601,8 +685,13 @@ void ExpressionInfixOperator(struct ParseState *Parser, struct ExpressionStack *
|
|||
else if (BottomValue->Typ->Base == TypePointer && TopValue->Typ->Base == TypePointer && Op != TokenAssign)
|
||||
{
|
||||
/* pointer/pointer operations */
|
||||
#ifndef NATIVE_POINTERS
|
||||
void *TopLoc = (void *)TopValue->Val->Pointer.Segment->Val + TopValue->Val->Pointer.Offset;
|
||||
void *BottomLoc = (void *)BottomValue->Val->Pointer.Segment->Val + BottomValue->Val->Pointer.Offset;
|
||||
#else
|
||||
void *TopLoc = (void *)TopValue->Val->NativePointer;
|
||||
void *BottomLoc = (void *)BottomValue->Val->NativePointer;
|
||||
#endif
|
||||
|
||||
switch (Op)
|
||||
{
|
||||
|
|
2
heap.c
2
heap.c
|
@ -10,11 +10,13 @@ static unsigned char *HeapMemory = (unsigned char *)C_HEAPSTART; /* all mem
|
|||
static void *HeapBottom = (void *)C_HEAPSTART + HEAP_SIZE; /* the bottom of the (downward-growing) heap */
|
||||
static void *StackFrame = (void *)C_HEAPSTART; /* the current stack frame */
|
||||
void *HeapStackTop = (void *)C_HEAPSTART; /* the top of the stack */
|
||||
void *HeapMemStart = (void *)C_HEAPSTART;
|
||||
#else
|
||||
static unsigned char HeapMemory[HEAP_SIZE]; /* all memory - stack and heap */
|
||||
static void *HeapBottom = &HeapMemory[HEAP_SIZE]; /* the bottom of the (downward-growing) heap */
|
||||
static void *StackFrame = &HeapMemory[0]; /* the current stack frame */
|
||||
void *HeapStackTop = &HeapMemory[0]; /* the top of the stack */
|
||||
void *HeapMemStart = &HeapMemory[0];
|
||||
#endif
|
||||
|
||||
static struct AllocNode *FreeListBucket[FREELIST_BUCKETS]; /* we keep a pool of freelist buckets to reduce fragmentation */
|
||||
|
|
5
lex.c
5
lex.c
|
@ -296,9 +296,12 @@ enum LexToken LexGetStringConstant(struct LexState *Lexer, struct Value *Value)
|
|||
|
||||
/* create the the pointer for this char* */
|
||||
Value->Typ = CharPtrType;
|
||||
#ifndef NATIVE_POINTERS
|
||||
Value->Val->Pointer.Segment = ArrayValue;
|
||||
Value->Val->Pointer.Offset = 0;
|
||||
|
||||
#else
|
||||
Value->Val->NativePointer = ArrayValue;
|
||||
#endif
|
||||
if (*Lexer->Pos == '"')
|
||||
Lexer->Pos++;
|
||||
|
||||
|
|
4
parse.c
4
parse.c
|
@ -382,7 +382,11 @@ int ParseStatement(struct ParseState *Parser)
|
|||
if (LexGetToken(Parser, &LexerValue, TRUE) != TokenStringConstant)
|
||||
ProgramFail(Parser, "\"filename.h\" expected");
|
||||
|
||||
#ifndef NATIVE_POINTERS
|
||||
PlatformScanFile(LexerValue->Val->Pointer.Segment->Val->Array.Data);
|
||||
#else
|
||||
PlatformScanFile(((struct Value *)(LexerValue->Val->NativePointer))->Val->Array.Data);
|
||||
#endif
|
||||
CheckTrailingSemicolon = FALSE;
|
||||
break;
|
||||
#endif
|
||||
|
|
17
picoc.h
17
picoc.h
|
@ -148,26 +148,34 @@ struct ArrayValue
|
|||
void *Data; /* pointer to the array data */
|
||||
};
|
||||
|
||||
#ifndef NATIVE_POINTERS
|
||||
struct PointerValue
|
||||
{
|
||||
struct Value *Segment; /* array or basic value which this points to, NULL for machine memory access */
|
||||
unsigned int Offset; /* index into an array */
|
||||
};
|
||||
#endif
|
||||
|
||||
union AnyValue
|
||||
{
|
||||
unsigned char Character;
|
||||
short ShortInteger;
|
||||
int Integer;
|
||||
#ifndef NO_FP
|
||||
double FP;
|
||||
#endif
|
||||
char *Identifier;
|
||||
struct ArrayValue Array;
|
||||
struct PointerValue Pointer;
|
||||
struct ParseState Parser;
|
||||
struct ValueType *Typ;
|
||||
struct FuncDef FuncDef;
|
||||
|
||||
#ifndef NO_FP
|
||||
double FP;
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_POINTERS
|
||||
struct PointerValue Pointer; /* safe pointers */
|
||||
#else
|
||||
void *NativePointer; /* unsafe native pointers */
|
||||
#endif
|
||||
};
|
||||
|
||||
struct Value
|
||||
|
@ -254,6 +262,7 @@ struct OutputStream
|
|||
|
||||
/* globals */
|
||||
extern void *HeapStackTop;
|
||||
extern void *HeapMemStart;
|
||||
extern struct Table GlobalTable;
|
||||
extern struct StackFrame *TopStackFrame;
|
||||
extern struct ValueType UberType;
|
||||
|
|
10
type.c
10
type.c
|
@ -47,7 +47,11 @@ struct ValueType *TypeGetMatching(struct ParseState *Parser, struct ValueType *P
|
|||
|
||||
switch (Base)
|
||||
{
|
||||
#ifndef NATIVE_POINTERS
|
||||
case TypePointer: Sizeof = sizeof(struct PointerValue); break;
|
||||
#else
|
||||
case TypePointer: Sizeof = sizeof(void *); break;
|
||||
#endif
|
||||
case TypeArray: Sizeof = sizeof(struct ArrayValue) + ArraySize * ParentType->Sizeof; break;
|
||||
case TypeEnum: Sizeof = sizeof(int); break;
|
||||
default: Sizeof = 0; break; /* structs and unions will get bigger when we add members to them */
|
||||
|
@ -123,8 +127,12 @@ void TypeInit()
|
|||
TypeAddBaseType(&FunctionType, TypeFunction, sizeof(int));
|
||||
TypeAddBaseType(&MacroType, TypeMacro, sizeof(int));
|
||||
TypeAddBaseType(&CharType, TypeChar, sizeof(char));
|
||||
CharPtrType = TypeAdd(NULL, &CharType, TypePointer, 0, StrEmpty, sizeof(struct PointerValue));
|
||||
CharArrayType = TypeAdd(NULL, &CharType, TypeArray, 0, StrEmpty, sizeof(char));
|
||||
#ifndef NATIVE_POINTERS
|
||||
CharPtrType = TypeAdd(NULL, &CharType, TypePointer, 0, StrEmpty, sizeof(struct PointerValue));
|
||||
#else
|
||||
CharPtrType = TypeAdd(NULL, &CharType, TypePointer, 0, StrEmpty, sizeof(void *));
|
||||
#endif
|
||||
}
|
||||
|
||||
/* deallocate heap-allocated types */
|
||||
|
|
16
variable.c
16
variable.c
|
@ -264,8 +264,10 @@ void VariableStringLiteralDefine(char *Ident, struct Value *Val)
|
|||
/* check a pointer for validity and dereference it for use */
|
||||
void *VariableDereferencePointer(struct ParseState *Parser, struct Value *PointerValue, struct Value **DerefVal, int *DerefOffset, struct ValueType **DerefType)
|
||||
{
|
||||
#ifndef NATIVE_POINTERS
|
||||
struct Value *PointedToValue = PointerValue->Val->Pointer.Segment;
|
||||
|
||||
/* this is a pointer to picoc memory */
|
||||
if (PointerValue->Typ->Base != TypePointer)
|
||||
ProgramFail(Parser, "pointer expected");
|
||||
|
||||
|
@ -288,4 +290,18 @@ void *VariableDereferencePointer(struct ParseState *Parser, struct Value *Pointe
|
|||
return PointedToValue->Val->Array.Data + PointerValue->Val->Pointer.Offset;
|
||||
else
|
||||
return (void *)PointedToValue->Val + PointerValue->Val->Pointer.Offset;
|
||||
#else
|
||||
struct Value *PointedToValue = PointerValue->Val->NativePointer;
|
||||
|
||||
/* check if the pointed to item is within picoc's memory range */
|
||||
if (PointerValue->Val->NativePointer - HeapMemStart >= HEAP_SIZE)
|
||||
*DerefVal = NULL;
|
||||
else
|
||||
*DerefVal = PointedToValue;
|
||||
|
||||
*DerefType = PointerValue->Typ->FromType;
|
||||
*DerefOffset = 0;
|
||||
|
||||
return PointerValue->Val->NativePointer;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue