Skip to content

Commit

Permalink
[Bugfix] Segfault during rendering due to nullptr (apache#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
junrushao committed Jul 2, 2022
1 parent ee83019 commit 0843e5d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/tvm/script/parse/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"""The core parser"""
from typing import Any, Dict, List, Optional, Union

from ...error import DiagnosticError
from ..builder import def_
from . import dispatch, doc
from .diagnostics import Diagnostics
Expand All @@ -37,6 +38,8 @@ def _dispatch_wrapper(func: dispatch.ParseMethod) -> dispatch.ParseMethod:
def _wrapper(self: Parser, node: doc.AST) -> None:
try:
return func(self, node)
except DiagnosticError:
raise
except Exception as e:
self.report_error(node, str(e))
raise
Expand Down

0 comments on commit 0843e5d

Please sign in to comment.