Fixed some bugs in cast operator.

This commit is contained in:
Eric Pouech 2003-01-05 20:38:05 +00:00 committed by Alexandre Julliard
parent 52395b0eb9
commit 9ca4119688
1 changed files with 3 additions and 5 deletions

View File

@ -321,15 +321,13 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp)
switch(exp->type) switch(exp->type)
{ {
case EXPR_TYPE_CAST: case EXPR_TYPE_CAST:
rtn = DEBUG_EvalExpr(exp->un.cast.expr); if (!exp->un.cast.cast)
rtn.type = exp->un.cast.cast;
if (!rtn.type)
{ {
DEBUG_Printf(DBG_CHN_MESG, "Can't cast to unknown type\n"); DEBUG_Printf(DBG_CHN_MESG, "Can't cast to unknown type\n");
RaiseException(DEBUG_STATUS_BAD_TYPE, 0, 0, NULL); RaiseException(DEBUG_STATUS_BAD_TYPE, 0, 0, NULL);
} }
if (DEBUG_GetType(rtn.type) == DT_POINTER) rtn = DEBUG_EvalExpr(exp->un.cast.expr);
rtn.cookie = DV_TARGET; rtn.type = exp->un.cast.cast;
break; break;
case EXPR_TYPE_STRING: case EXPR_TYPE_STRING:
rtn.type = DEBUG_GetBasicType(DT_BASIC_STRING); rtn.type = DEBUG_GetBasicType(DT_BASIC_STRING);