Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Unified Diff: runtime/vm/object.cc

Issue 10143004: Map malformed function result type and malformed function parameter type to (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 6776)
+++ runtime/vm/object.cc (working copy)
@@ -2156,6 +2156,25 @@
Error* malformed_error) const {
ASSERT(IsFinalized());
ASSERT(other.IsFinalized());
+ // In case the type checked in a type test is malformed, the code generator
+ // may compile a throw instead of a run time call performing the type check.
+ // However, in checked mode, a function type may include malformed result type
+ // and/or malformed parameter types, which will then be encountered here at
+ // run time.
+ if (IsMalformed()) {
+ ASSERT(FLAG_enable_type_checks);
+ if (malformed_error->IsNull()) {
+ *malformed_error = this->malformed_error();
+ }
+ return false;
+ }
+ if (other.IsMalformed()) {
+ ASSERT(FLAG_enable_type_checks);
+ if (malformed_error->IsNull()) {
+ *malformed_error = other.malformed_error();
+ }
+ return false;
+ }
// AbstractType parameters cannot be handled by Class::IsSubtypeOf().
if (IsTypeParameter() || other.IsTypeParameter()) {
// An uninstantiated type parameter is equivalent to Dynamic.
@@ -6563,6 +6582,7 @@
ASSERT(other.IsFinalized());
ASSERT(!other.IsDynamicType());
ASSERT(!other.IsVoidType());
+ ASSERT(!other.IsMalformed());
if (IsNull()) {
Class& other_class = Class::Handle();
if (other.IsTypeParameter()) {
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698