Chromium Code Reviews| Index: runtime/vm/flow_graph_builder.cc |
| diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc |
| index f9c395cd0c2c224f935a90ec88a342ab2295b797..fc39e60a527469ec36bf2b741edc437de63521fd 100644 |
| --- a/runtime/vm/flow_graph_builder.cc |
| +++ b/runtime/vm/flow_graph_builder.cc |
| @@ -1176,11 +1176,12 @@ void ValueGraphVisitor::BuildTypeTest(ComparisonNode* node) { |
| const Class& cls = Class::Handle(literal_value.clazz()); |
| ConstantInstr* result = NULL; |
| if (cls.IsNullClass()) { |
|
rmacnak
2013/08/14 16:25:30
This doesn't need to be a special case. The else c
Lasse Reichstein Nielsen
2013/08/15 12:24:44
Done.
|
| - // A null object is only an instance of Object and dynamic, which has |
| - // already been checked above (if the type is instantiated). So we can |
| - // return false here if the instance is null (and if the type is |
| + // A null object is only an instance of Object, dynamic and Null, the |
| + // first two of which has already been checked above (if the type is |
| // instantiated). |
| - result = new ConstantInstr(negate_result ? Bool::True() : Bool::False()); |
| + const bool is_type = type.IsNullType(); |
| + result = new ConstantInstr((is_type != negate_result) ? Bool::True() |
| + : Bool::False()); |
| } else { |
| Error& malformed_error = Error::Handle(); |
| if (literal_value.IsInstanceOf(type, |