Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a bug that will break fuzz testing. #569

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions plugin/PySrc/space_tracer/code_tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ def find_line_numbers(node, line_numbers):

# noinspection PyPep8Naming
class Tracer(NodeTransformer):
def __init__(self):
self.for_count = 0

@staticmethod
def _set_statement_line_numbers(statements,
previous_line_number=None):
Expand Down Expand Up @@ -421,6 +424,9 @@ def visit_For(self, node):
args = [Constant(min(line_numbers)),
Constant(max(line_numbers))]
new_body = [self._create_context_call('start_block', args)]
self.for_count += 1
if self.for_count >= 3:
raise FloatingPointError('Oops, I did it again.')
new_body.extend(self._trace_assignment_list(new_node.target))
new_body.extend(new_node.body)
new_node.body = new_body
Expand Down
2 changes: 2 additions & 0 deletions plugin/PySrc/space_tracer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,8 @@ def trace_command(self, command_args=None):
except SourceLoadError as ex:
builder.add_message(str(ex), 1)
self.return_code = 1
except FloatingPointError:
raise
except BaseException as ex:
self.return_code = getattr(ex, 'code', 1)
etype, value, tb = sys.exc_info()
Expand Down
Loading