Renamed exprhs to ExprLoad

git-svn-id: svn://svn.cc65.org/cc65/trunk@2426 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2003-08-29 09:16:28 +00:00
parent e6568c9763
commit 14fc5c1073
7 changed files with 59 additions and 57 deletions

View File

@@ -87,7 +87,7 @@ int Assignment (ExprDesc* lval)
if (UseReg) { if (UseReg) {
PushAddr (lval); PushAddr (lval);
} else { } else {
exprhs (0, 0, lval); ExprLoad (0, 0, lval);
g_push (CF_PTR | CF_UNSIGNED, 0); g_push (CF_PTR | CF_UNSIGNED, 0);
} }
@@ -107,7 +107,7 @@ int Assignment (ExprDesc* lval)
lval2.Type = stype; lval2.Type = stype;
/* Load the value into the primary */ /* Load the value into the primary */
exprhs (CF_FORCECHAR, k, &lval2); ExprLoad (CF_FORCECHAR, k, &lval2);
/* Store it into the new location */ /* Store it into the new location */
Store (lval, stype); Store (lval, stype);
@@ -115,7 +115,7 @@ int Assignment (ExprDesc* lval)
} else { } else {
/* We will use memcpy. Push the address of the rhs */ /* We will use memcpy. Push the address of the rhs */
exprhs (0, 0, &lval2); ExprLoad (0, 0, &lval2);
/* Push the address (or whatever is in ax in case of errors) */ /* Push the address (or whatever is in ax in case of errors) */
g_push (CF_PTR | CF_UNSIGNED, 0); g_push (CF_PTR | CF_UNSIGNED, 0);
@@ -158,7 +158,7 @@ int Assignment (ExprDesc* lval)
k = TypeConversion (&lval2, k, ltype); k = TypeConversion (&lval2, k, ltype);
/* If necessary, load the value into the primary register */ /* If necessary, load the value into the primary register */
exprhs (CF_NONE, k, &lval2); ExprLoad (CF_NONE, k, &lval2);
/* Generate a store instruction */ /* Generate a store instruction */
Store (lval, 0); Store (lval, 0);

View File

@@ -413,8 +413,10 @@ void CheckBoolExpr (ExprDesc* lval)
void exprhs (unsigned Flags, int k, ExprDesc* Expr) void ExprLoad (unsigned Flags, int k, ExprDesc* Expr)
/* Put the result of an expression into the primary register */ /* Place the result of an expression into the primary register if it is not
* already there.
*/
{ {
int f; int f;
@@ -572,7 +574,7 @@ static unsigned FunctionParamList (FuncDesc* Func)
} }
/* Load the value into the primary if it is not already there */ /* Load the value into the primary if it is not already there */
exprhs (Flags, k, &Expr); ExprLoad (Flags, k, &Expr);
/* Use the type of the argument for the push */ /* Use the type of the argument for the push */
Flags |= TypeOf (Expr.Type); Flags |= TypeOf (Expr.Type);
@@ -664,7 +666,7 @@ static void FunctionCall (int k, ExprDesc* lval)
/* Not a global or local variable, or a fastcall function. Load /* Not a global or local variable, or a fastcall function. Load
* the pointer into the primary and mark it as an expression. * the pointer into the primary and mark it as an expression.
*/ */
exprhs (CF_NONE, k, lval); ExprLoad (CF_NONE, k, lval);
lval->Flags |= E_MEXPR; lval->Flags |= E_MEXPR;
/* Remember the code position */ /* Remember the code position */
@@ -714,7 +716,7 @@ static void FunctionCall (int k, ExprDesc* lval)
} }
} else { } else {
/* Load from original location */ /* Load from original location */
exprhs (CF_NONE, k, lval); ExprLoad (CF_NONE, k, lval);
} }
/* Call the function */ /* Call the function */
@@ -984,7 +986,7 @@ static int arrayref (int k, ExprDesc* lval)
Mark2 = 0; /* Silence gcc */ Mark2 = 0; /* Silence gcc */
if (!ConstBaseAddr) { if (!ConstBaseAddr) {
/* Get a pointer to the array into the primary */ /* Get a pointer to the array into the primary */
exprhs (CF_NONE, k, lval); ExprLoad (CF_NONE, k, lval);
/* Get the array pointer on stack. Do not push more than 16 /* Get the array pointer on stack. Do not push more than 16
* bit, even if this value is greater, since we cannot handle * bit, even if this value is greater, since we cannot handle
@@ -1004,7 +1006,7 @@ static int arrayref (int k, ExprDesc* lval)
pop (CF_PTR); pop (CF_PTR);
} else { } else {
/* Get an array pointer into the primary */ /* Get an array pointer into the primary */
exprhs (CF_NONE, k, lval); ExprLoad (CF_NONE, k, lval);
} }
if (IsClassPtr (tptr1)) { if (IsClassPtr (tptr1)) {
@@ -1029,7 +1031,7 @@ static int arrayref (int k, ExprDesc* lval)
} else { } else {
/* Pointer - load into primary and remember offset */ /* Pointer - load into primary and remember offset */
if ((lval->Flags & E_MEXPR) == 0 || k != 0) { if ((lval->Flags & E_MEXPR) == 0 || k != 0) {
exprhs (CF_NONE, k, lval); ExprLoad (CF_NONE, k, lval);
} }
lval->ConstVal = lval2.ConstVal; lval->ConstVal = lval2.ConstVal;
lval->Flags = E_MEOFFS; lval->Flags = E_MEOFFS;
@@ -1063,7 +1065,7 @@ static int arrayref (int k, ExprDesc* lval)
/* Array subscript is not constant. Load it into the primary */ /* Array subscript is not constant. Load it into the primary */
Mark2 = GetCodePos (); Mark2 = GetCodePos ();
exprhs (CF_NONE, l, &lval2); ExprLoad (CF_NONE, l, &lval2);
tptr2 = lval2.Type; tptr2 = lval2.Type;
if (IsClassPtr (tptr1)) { if (IsClassPtr (tptr1)) {
@@ -1090,7 +1092,7 @@ static int arrayref (int k, ExprDesc* lval)
*/ */
if (ConstBaseAddr) { if (ConstBaseAddr) {
g_push (CF_INT, 0); g_push (CF_INT, 0);
exprhs (CF_NONE, k, lval); ExprLoad (CF_NONE, k, lval);
ConstBaseAddr = 0; ConstBaseAddr = 0;
} else { } else {
g_swap (CF_INT); g_swap (CF_INT);
@@ -1140,7 +1142,7 @@ static int arrayref (int k, ExprDesc* lval)
*/ */
SavedType = lval->Type; SavedType = lval->Type;
lval->Type = tptr1; lval->Type = tptr1;
exprhs (CF_NONE, k, lval); ExprLoad (CF_NONE, k, lval);
lval->Type = SavedType; lval->Type = SavedType;
/* Add the variable */ /* Add the variable */
@@ -1217,7 +1219,7 @@ static int structref (int k, ExprDesc* lval)
lval->ConstVal += Field->V.Offs; lval->ConstVal += Field->V.Offs;
} else { } else {
if ((flags & E_MEXPR) == 0 || k != 0) { if ((flags & E_MEXPR) == 0 || k != 0) {
exprhs (CF_NONE, k, lval); ExprLoad (CF_NONE, k, lval);
} }
lval->ConstVal = Field->V.Offs; lval->ConstVal = Field->V.Offs;
lval->Flags = E_MEOFFS; lval->Flags = E_MEOFFS;
@@ -1370,7 +1372,7 @@ static void pre_incdec (ExprDesc* lval, void (*inc) (unsigned, unsigned long))
PushAddr (lval); PushAddr (lval);
/* Fetch the value */ /* Fetch the value */
exprhs (CF_NONE, k, lval); ExprLoad (CF_NONE, k, lval);
/* Increment value in primary */ /* Increment value in primary */
inc (flags, val); inc (flags, val);
@@ -1441,7 +1443,7 @@ static void post_incdec (ExprDesc* lval, int k, void (*inc) (unsigned, unsigned
PushAddr (lval); PushAddr (lval);
/* Fetch the value and save it (since it's the result of the expression) */ /* Fetch the value and save it (since it's the result of the expression) */
exprhs (CF_NONE, 1, lval); ExprLoad (CF_NONE, 1, lval);
g_save (flags | CF_FORCECHAR); g_save (flags | CF_FORCECHAR);
/* If we have a pointer expression, increment by the size of the type */ /* If we have a pointer expression, increment by the size of the type */
@@ -1479,7 +1481,7 @@ static void unaryop (int tok, ExprDesc* lval)
} }
} else { } else {
/* Value is not constant */ /* Value is not constant */
exprhs (CF_NONE, k, lval); ExprLoad (CF_NONE, k, lval);
/* Get the type of the expression */ /* Get the type of the expression */
flags = TypeOf (lval->Type); flags = TypeOf (lval->Type);
@@ -1659,7 +1661,7 @@ static int hie_internal (const GenDesc** ops, /* List of generators */
g_push (ltype | CF_CONST, lval->ConstVal); g_push (ltype | CF_CONST, lval->ConstVal);
} else { } else {
/* Value not constant */ /* Value not constant */
exprhs (CF_NONE, k, lval); ExprLoad (CF_NONE, k, lval);
Mark2 = GetCodePos (); Mark2 = GetCodePos ();
g_push (ltype, 0); g_push (ltype, 0);
} }
@@ -1759,7 +1761,7 @@ static int hie_compare (const GenDesc** ops, /* List of generators */
g_push (ltype | CF_CONST, lval->ConstVal); g_push (ltype | CF_CONST, lval->ConstVal);
} else { } else {
/* Value not constant */ /* Value not constant */
exprhs (CF_NONE, k, lval); ExprLoad (CF_NONE, k, lval);
Mark2 = GetCodePos (); Mark2 = GetCodePos ();
g_push (ltype, 0); g_push (ltype, 0);
} }
@@ -1921,7 +1923,7 @@ static void parseadd (int k, ExprDesc* lval)
/* lhs is a constant and rhs is not constant. Load rhs into /* lhs is a constant and rhs is not constant. Load rhs into
* the primary. * the primary.
*/ */
exprhs (CF_NONE, k, &lval2); ExprLoad (CF_NONE, k, &lval2);
/* Beware: The check above (for lhs) lets not only pass numeric /* Beware: The check above (for lhs) lets not only pass numeric
* constants, but also constant addresses (labels), maybe even * constants, but also constant addresses (labels), maybe even
@@ -2007,7 +2009,7 @@ static void parseadd (int k, ExprDesc* lval)
} else { } else {
/* Left hand side is not constant. Get the value onto the stack. */ /* Left hand side is not constant. Get the value onto the stack. */
exprhs (CF_NONE, k, lval); /* --> primary register */ ExprLoad (CF_NONE, k, lval); /* --> primary register */
Mark = GetCodePos (); Mark = GetCodePos ();
g_push (TypeOf (lval->Type), 0); /* --> stack */ g_push (TypeOf (lval->Type), 0); /* --> stack */
@@ -2122,7 +2124,7 @@ static void parsesub (int k, ExprDesc* lval)
/* Remember the output queue position, then bring the value onto the stack */ /* Remember the output queue position, then bring the value onto the stack */
Mark1 = GetCodePos (); Mark1 = GetCodePos ();
exprhs (CF_NONE, k, lval); /* --> primary register */ ExprLoad (CF_NONE, k, lval); /* --> primary register */
Mark2 = GetCodePos (); Mark2 = GetCodePos ();
g_push (TypeOf (lhst), 0); /* --> stack */ g_push (TypeOf (lhst), 0); /* --> stack */
@@ -2454,7 +2456,7 @@ static int hieAnd (ExprDesc* lval, unsigned TrueLab, int* BoolOp)
} }
/* Load the value */ /* Load the value */
exprhs (CF_FORCECHAR, k, lval); ExprLoad (CF_FORCECHAR, k, lval);
/* Generate the jump */ /* Generate the jump */
g_falsejump (CF_NONE, lab); g_falsejump (CF_NONE, lab);
@@ -2470,7 +2472,7 @@ static int hieAnd (ExprDesc* lval, unsigned TrueLab, int* BoolOp)
if ((lval2.Test & E_CC) == 0) { if ((lval2.Test & E_CC) == 0) {
lval2.Test |= E_FORCETEST; lval2.Test |= E_FORCETEST;
} }
exprhs (CF_FORCECHAR, k, &lval2); ExprLoad (CF_FORCECHAR, k, &lval2);
/* Do short circuit evaluation */ /* Do short circuit evaluation */
if (CurTok.Tok == TOK_BOOL_AND) { if (CurTok.Tok == TOK_BOOL_AND) {
@@ -2519,7 +2521,7 @@ static int hieOr (ExprDesc *lval)
} }
/* Get first expr */ /* Get first expr */
exprhs (CF_FORCECHAR, k, lval); ExprLoad (CF_FORCECHAR, k, lval);
/* For each expression jump to TrueLab if true. Beware: If we /* For each expression jump to TrueLab if true. Beware: If we
* had && operators, the jump is already in place! * had && operators, the jump is already in place!
@@ -2543,7 +2545,7 @@ static int hieOr (ExprDesc *lval)
if ((lval2.Test & E_CC) == 0) { if ((lval2.Test & E_CC) == 0) {
lval2.Test |= E_FORCETEST; lval2.Test |= E_FORCETEST;
} }
exprhs (CF_FORCECHAR, k, &lval2); ExprLoad (CF_FORCECHAR, k, &lval2);
/* If there is more to come, add shortcut boolean eval. */ /* If there is more to come, add shortcut boolean eval. */
g_truejump (CF_NONE, TrueLab); g_truejump (CF_NONE, TrueLab);
@@ -2588,7 +2590,7 @@ static int hieQuest (ExprDesc* lval)
/* Condition codes not set, force a test */ /* Condition codes not set, force a test */
lval->Test |= E_FORCETEST; lval->Test |= E_FORCETEST;
} }
exprhs (CF_NONE, k1, lval); ExprLoad (CF_NONE, k1, lval);
labf = GetLocalLabel (); labf = GetLocalLabel ();
g_falsejump (CF_NONE, labf); g_falsejump (CF_NONE, labf);
@@ -2599,7 +2601,7 @@ static int hieQuest (ExprDesc* lval)
Expr2IsNULL = IsNullPtr (&Expr2); Expr2IsNULL = IsNullPtr (&Expr2);
if (!IsTypeVoid (Expr2.Type)) { if (!IsTypeVoid (Expr2.Type)) {
/* Load it into the primary */ /* Load it into the primary */
exprhs (CF_NONE, k2, &Expr2); ExprLoad (CF_NONE, k2, &Expr2);
Expr2.Flags = E_MEXPR; Expr2.Flags = E_MEXPR;
k2 = 0; k2 = 0;
} }
@@ -2617,7 +2619,7 @@ static int hieQuest (ExprDesc* lval)
Expr3IsNULL = IsNullPtr (&Expr3); Expr3IsNULL = IsNullPtr (&Expr3);
if (!IsTypeVoid (Expr3.Type)) { if (!IsTypeVoid (Expr3.Type)) {
/* Load it into the primary */ /* Load it into the primary */
exprhs (CF_NONE, k3, &Expr3); ExprLoad (CF_NONE, k3, &Expr3);
Expr3.Flags = E_MEXPR; Expr3.Flags = E_MEXPR;
k3 = 0; k3 = 0;
} }
@@ -2718,7 +2720,7 @@ static void opeq (const GenDesc* Gen, ExprDesc *lval, int k)
PushAddr (lval); PushAddr (lval);
/* Fetch the lhs into the primary register if needed */ /* Fetch the lhs into the primary register if needed */
exprhs (CF_NONE, k, lval); ExprLoad (CF_NONE, k, lval);
/* Bring the lhs on stack */ /* Bring the lhs on stack */
Mark = GetCodePos (); Mark = GetCodePos ();
@@ -2822,7 +2824,7 @@ static void addsubeq (const GenDesc* Gen, ExprDesc *lval, int k)
lflags |= CF_CONST; lflags |= CF_CONST;
} else { } else {
/* Not constant, load into the primary */ /* Not constant, load into the primary */
exprhs (CF_NONE, k, &lval2); ExprLoad (CF_NONE, k, &lval2);
if (MustScale) { if (MustScale) {
/* lhs is a pointer, scale rhs */ /* lhs is a pointer, scale rhs */
g_scale (TypeOf (lval2.Type), CheckedSizeOf (lval->Type+1)); g_scale (TypeOf (lval2.Type), CheckedSizeOf (lval->Type+1));
@@ -2962,7 +2964,7 @@ int hie0 (ExprDesc *lval)
int evalexpr (unsigned flags, int (*f) (ExprDesc*), ExprDesc* lval) int evalexpr (unsigned flags, int (*f) (ExprDesc*), ExprDesc* lval)
/* Will evaluate an expression via the given function. If the result is a /* Will evaluate an expression via the given function. If the result is a
* constant, 0 is returned and the value is put in the lval struct. If the * constant, 0 is returned and the value is put in the lval struct. If the
* result is not constant, exprhs is called to bring the value into the * result is not constant, ExprLoad is called to bring the value into the
* primary register and 1 is returned. * primary register and 1 is returned.
*/ */
{ {
@@ -2975,7 +2977,7 @@ int evalexpr (unsigned flags, int (*f) (ExprDesc*), ExprDesc* lval)
return 0; return 0;
} else { } else {
/* Not constant, load into the primary */ /* Not constant, load into the primary */
exprhs (flags, k, lval); ExprLoad (flags, k, lval);
return 1; return 1;
} }
} }
@@ -3011,7 +3013,7 @@ void expression1 (ExprDesc* lval)
*/ */
{ {
InitExprDesc (lval); InitExprDesc (lval);
exprhs (CF_NONE, expr (hie1, lval), lval); ExprLoad (CF_NONE, expr (hie1, lval), lval);
} }
@@ -3020,7 +3022,7 @@ void expression (ExprDesc* lval)
/* Evaluate an expression and put it into the primary register */ /* Evaluate an expression and put it into the primary register */
{ {
InitExprDesc (lval); InitExprDesc (lval);
exprhs (CF_NONE, expr (hie0, lval), lval); ExprLoad (CF_NONE, expr (hie0, lval), lval);
} }
@@ -3099,7 +3101,7 @@ void Test (unsigned Label, int Invert)
} }
/* Load the value into the primary register */ /* Load the value into the primary register */
exprhs (CF_FORCECHAR, k, &lval); ExprLoad (CF_FORCECHAR, k, &lval);
/* Generate the jump */ /* Generate the jump */
if (Invert) { if (Invert) {

View File

@@ -42,7 +42,7 @@ void CheckBoolExpr (ExprDesc* lval);
* if not. * if not.
*/ */
void exprhs (unsigned flags, int k, ExprDesc *lval); void ExprLoad (unsigned flags, int k, ExprDesc *lval);
/* Put the result of an expression into the primary register */ /* Put the result of an expression into the primary register */
void Store (ExprDesc* lval, const type* StoreType); void Store (ExprDesc* lval, const type* StoreType);
@@ -57,7 +57,7 @@ int hie0 (ExprDesc *lval);
int evalexpr (unsigned flags, int (*f) (ExprDesc*), ExprDesc* lval); int evalexpr (unsigned flags, int (*f) (ExprDesc*), ExprDesc* lval);
/* Will evaluate an expression via the given function. If the result is a /* Will evaluate an expression via the given function. If the result is a
* constant, 0 is returned and the value is put in the lval struct. If the * constant, 0 is returned and the value is put in the lval struct. If the
* result is not constant, exprhs is called to bring the value into the * result is not constant, ExprLoad is called to bring the value into the
* primary register and 1 is returned. * primary register and 1 is returned.
*/ */

View File

@@ -117,7 +117,7 @@ static unsigned ParseRegisterDecl (Declaration* Decl, unsigned* SC, int Reg)
k = TypeConversion (&lval, k, Decl->Type); k = TypeConversion (&lval, k, Decl->Type);
/* Load the value into the primary */ /* Load the value into the primary */
exprhs (CF_NONE, k, &lval); ExprLoad (CF_NONE, k, &lval);
/* Store the value into the variable */ /* Store the value into the variable */
g_putstatic (CF_REGVAR | TypeOf (Decl->Type), Reg, 0); g_putstatic (CF_REGVAR | TypeOf (Decl->Type), Reg, 0);
@@ -218,7 +218,7 @@ static unsigned ParseAutoDecl (Declaration* Decl, unsigned* SC)
* Otherwise pass the information to the code generator. * Otherwise pass the information to the code generator.
*/ */
if (k != 0 || lval.Flags != E_MCONST) { if (k != 0 || lval.Flags != E_MCONST) {
exprhs (CF_NONE, k, &lval); ExprLoad (CF_NONE, k, &lval);
k = 0; k = 0;
} else { } else {
Flags |= CF_CONST; Flags |= CF_CONST;
@@ -291,7 +291,7 @@ static unsigned ParseAutoDecl (Declaration* Decl, unsigned* SC)
k = TypeConversion (&lval, k, Decl->Type); k = TypeConversion (&lval, k, Decl->Type);
/* Load the value into the primary */ /* Load the value into the primary */
exprhs (CF_NONE, k, &lval); ExprLoad (CF_NONE, k, &lval);
/* Store the value into the variable */ /* Store the value into the variable */
g_putstatic (TypeOf (Decl->Type), SymData, 0); g_putstatic (TypeOf (Decl->Type), SymData, 0);

View File

@@ -6,10 +6,10 @@
/* */ /* */
/* */ /* */
/* */ /* */
/* (C) 1998 Ullrich von Bassewitz */ /* (C) 1998-2003 Ullrich von Bassewitz */
/* Wacholderweg 14 */ /* R<>merstrasse 52 */
/* D-70597 Stuttgart */ /* D-70794 Filderstadt */
/* EMail: uz@musoftware.de */ /* EMail: uz@cc65.org */
/* */ /* */
/* */ /* */
/* This software is provided 'as-is', without any expressed or implied */ /* This software is provided 'as-is', without any expressed or implied */
@@ -125,7 +125,7 @@ static unsigned ParseArg (type* Type, ExprDesc* Arg)
if (k != 0 || Arg->Flags != E_MCONST) { if (k != 0 || Arg->Flags != E_MCONST) {
/* Load into the primary */ /* Load into the primary */
exprhs (CF_NONE, k, Arg); ExprLoad (CF_NONE, k, Arg);
k = 0; k = 0;
} else { } else {
@@ -194,7 +194,7 @@ static void StdFunc_memset (FuncDesc* F attribute ((unused)),
*/ */
Flags = ParseArg (Arg3Type, &Arg); Flags = ParseArg (Arg3Type, &Arg);
if (Flags & CF_CONST) { if (Flags & CF_CONST) {
exprhs (CF_FORCECHAR, 0, &Arg); ExprLoad (CF_FORCECHAR, 0, &Arg);
} }
/* Emit the actual function call */ /* Emit the actual function call */
@@ -264,7 +264,7 @@ static void StdFunc_strlen (FuncDesc* F attribute ((unused)),
ExprDesc Length; ExprDesc Length;
MakeConstIntExpr (&Length, strlen (GetLiteral (Param.ConstVal))); MakeConstIntExpr (&Length, strlen (GetLiteral (Param.ConstVal)));
ResetLiteralPoolOffs (Param.ConstVal); ResetLiteralPoolOffs (Param.ConstVal);
exprhs (CF_NONE, 0, &Length); ExprLoad (CF_NONE, 0, &Length);
goto ExitPoint; goto ExitPoint;
} else { } else {
CodeFlags |= CF_CONST | CF_STATIC; CodeFlags |= CF_CONST | CF_STATIC;
@@ -279,7 +279,7 @@ static void StdFunc_strlen (FuncDesc* F attribute ((unused)),
} else { } else {
/* Not an array with a constant address. Load parameter into primary */ /* Not an array with a constant address. Load parameter into primary */
exprhs (CF_NONE, k, &Param); ExprLoad (CF_NONE, k, &Param);
} }

View File

@@ -6,7 +6,7 @@
/* */ /* */
/* */ /* */
/* */ /* */
/* (C) 1998-2001 Ullrich von Bassewitz */ /* (C) 1998-2003 Ullrich von Bassewitz */
/* Wacholderweg 14 */ /* Wacholderweg 14 */
/* D-70597 Stuttgart */ /* D-70597 Stuttgart */
/* EMail: uz@cc65.org */ /* EMail: uz@cc65.org */
@@ -278,7 +278,7 @@ static void ReturnStatement (void)
TypeConversion (&Expr, k, F_GetReturnType (CurrentFunc)); TypeConversion (&Expr, k, F_GetReturnType (CurrentFunc));
/* Load the value into the primary */ /* Load the value into the primary */
exprhs (CF_NONE, k, &Expr); ExprLoad (CF_NONE, k, &Expr);
} }
} else if (!F_HasVoidReturn (CurrentFunc) && !F_HasOldStyleIntRet (CurrentFunc)) { } else if (!F_HasVoidReturn (CurrentFunc) && !F_HasOldStyleIntRet (CurrentFunc)) {

View File

@@ -109,7 +109,7 @@ static int DoConversion (ExprDesc* Expr, int k, type* NewType)
*/ */
if (NewSize > OldSize) { if (NewSize > OldSize) {
/* Load the value into the primary */ /* Load the value into the primary */
exprhs (CF_NONE, k, Expr); ExprLoad (CF_NONE, k, Expr);
/* Emit typecast code */ /* Emit typecast code */
g_typecast (TypeOf (NewType), TypeOf (OldType)); g_typecast (TypeOf (NewType), TypeOf (OldType));
@@ -158,7 +158,7 @@ static int DoConversion (ExprDesc* Expr, int k, type* NewType)
if (OldSize != NewSize) { if (OldSize != NewSize) {
/* Load the value into the primary */ /* Load the value into the primary */
exprhs (CF_NONE, k, Expr); ExprLoad (CF_NONE, k, Expr);
/* Emit typecast code. */ /* Emit typecast code. */
g_typecast (TypeOf (NewType) | CF_FORCECHAR, TypeOf (OldType)); g_typecast (TypeOf (NewType) | CF_FORCECHAR, TypeOf (OldType));