Skip to content

Commit

Permalink
Fixed a problem with explicit pointer/pointer casts not being allowed.
Browse files Browse the repository at this point in the history
git-svn-id: http://picoc.googlecode.com/svn/trunk@558 21eae674-98b7-11dd-bd71-f92a316d2d60
  • Loading branch information
zik.saleeba committed Feb 21, 2011
1 parent ae653d4 commit b1bd91a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions expression.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ void ExpressionAssignToPointer(struct ParseState *Parser, struct Value *ToValue,
/* assign integer to native pointer */
ToValue->Val->Pointer = (void *)(unsigned long)ExpressionCoerceUnsignedInteger(FromValue);
}
else if (AllowPointerCoercion && FromValue->Typ->Base == TypePointer)
{
/* assign a pointer to a pointer to a different type */
ToValue->Val->Pointer = FromValue->Val->Pointer;
}
else
AssignFail(Parser, "%t from %t", ToValue->Typ, FromValue->Typ, 0, 0, FuncName, ParamNo);
}
Expand Down

0 comments on commit b1bd91a

Please sign in to comment.