From 8f85f34d278ac11e2da8116945f9074a34021406 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Tue, 21 Jul 2015 16:25:16 -0700 Subject: [PATCH] Fix 2 crashers found by Hixie's fuzzer. The first one is that we weren't setting up a FontCachePurgePreventer during drawText. It's not clear that this is the correct fix, since Blink doesn't have this FontCachePurgePreventer here either, but it's also possible that they would hit this same ASSERT and just not care (since ASSERTs are disabled on clusterfuzz). The second fix is making ExceptionState actually track whether it has thrown an exception or not. The c++ code was depending on this working in order to return early from dom functions and not crash! R=abarth@google.com --- packages/flutter/example/raw/mutating-dom.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/flutter/example/raw/mutating-dom.dart b/packages/flutter/example/raw/mutating-dom.dart index 0d27a3f008..6de893c478 100644 --- a/packages/flutter/example/raw/mutating-dom.dart +++ b/packages/flutter/example/raw/mutating-dom.dart @@ -48,9 +48,12 @@ void doFrame(double timeStamp) { node = root; } else if (node != root && other != null && pickThis(0.1)) { report("insertBefore()"); - node.insertBefore([other]); + try { + node.insertBefore([other]); + } catch (_) { + } break; - } else if (pickThis(0.001)) { + } else if (node != root && pickThis(0.001)) { report("remove()"); node.remove(); } else if (node is sky.Element) { @@ -148,7 +151,7 @@ void doFrame(double timeStamp) { break; } } else { - assert(node is sky.Text); // + assert(node is sky.Text); final sky.Text text = node; if (pickThis(0.1)) { report("appending a new text node (ASCII)");