瀏覽代碼

LibWeb: Crash instead of spinning if parse_drawto fails to match

If parse_drawto fails to match anything, it will spin forever.
Instead, print out the character that failed to match and assert
false.
Luke 5 年之前
父節點
當前提交
65afb40fc5
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Libraries/LibWeb/SVG/SVGPathElement.cpp

+ 3 - 0
Libraries/LibWeb/SVG/SVGPathElement.cpp

@@ -133,6 +133,9 @@ void PathDataParser::parse_drawto() {
         parse_smooth_quadratic_bezier_curveto();
     } else if (match('A') || match('a')) {
         parse_elliptical_arc();
+    } else {
+        dbg() << "PathDataParser::parse_drawto failed to match: '" << ch() << "'";
+        TODO();
     }
 }