summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
49974e6)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@912
4a8a32a2-be11-0410-ad9d-
d568d2c75423
/* if this is a literal then we already know the result */
if (condAst->etype && IS_LITERAL (condAst->etype))
{
/* if this is a literal then we already know the result */
if (condAst->etype && IS_LITERAL (condAst->etype))
{
/* then depending on the expression value */
if (floatFromVal (condAst->opval.val))
ifxNode = newNode (GOTO,
/* then depending on the expression value */
if (floatFromVal (condAst->opval.val))
ifxNode = newNode (GOTO,
/* conditional operator '?' */
/*----------------------------*/
case '?':
/* conditional operator '?' */
/*----------------------------*/
case '?':
- /* the type is one on the left */
- TTYPE (tree) = LTYPE (tree);
+ /* the type is value of the colon operator (on the right) */
+ assert(IS_COLON_OP(tree->right));
+ TTYPE (tree) = RTYPE(tree); // #HACK LTYPE(tree).
TETYPE (tree) = getSpec (TTYPE (tree));
return tree;
TETYPE (tree) = getSpec (TTYPE (tree));
return tree;