Skip to content

Commit

Permalink
allow null in last operand of conditional operator in stage 0
Browse files Browse the repository at this point in the history
and use it stage 1
  • Loading branch information
NotFound committed Sep 5, 2011
1 parent d6436ff commit 5d83cd2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 5 additions & 2 deletions winxedst0.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// winxedst0.cpp
// Revision 23-aug-2011
// Revision 5-sep-2011

// Winxed compiler stage 0.

Expand Down Expand Up @@ -5087,7 +5087,10 @@ class OpConditionalExpr : public Expr
exprtrue->emit(e, result);
e << INDENT "goto " << label_end << '\n';
e << INDENTLABEL << label_false << ":\n";
exprfalse->emit(e, result);
if (exprfalse->isnull())
e << op_null(result) << '\n';
else
exprfalse->emit(e, result);
e << INDENTLABEL << label_end << ":\n";
}
Condition *condition;
Expand Down
4 changes: 1 addition & 3 deletions winxedst1.winxed
Original file line number Diff line number Diff line change
Expand Up @@ -9787,9 +9787,7 @@ class NamespacePath
function samehllas(fromns)
{
var hll = self.hll;
var fromhll;
if (fromns != null)
fromhll = fromns.hll;
var fromhll = fromns != null ? fromns.hll : null;
if (hll == null)
return fromhll == null;
else
Expand Down

0 comments on commit 5d83cd2

Please sign in to comment.