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

[AttributeError@constant_folding.py:137] AttributeError: 'UnknownType' object has no attribute 'signed' #358

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ def _constant_fold_shift(constants: list[Constant], fun: Callable[[int, int], in
raise IncompatibleOperandCount("Expected exactly 2 constants to fold")

left, right = constants
norm_signed = signed and isinstance(left.type, Integer) and left.type.signed

return fun(normalize_int(left.value, left.type.size, left.type.signed and signed), right.value)
return fun(normalize_int(left.value, left.type.size, norm_signed), right.value)


_OPERATION_TO_FOLD_FUNCTION: dict[OperationType, Callable[[list[Constant]], int]] = {
Expand Down
Loading