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

constant folding of some builtins results in compiler panic #3363

Closed
charles-cooper opened this issue Apr 19, 2023 · 5 comments · Fixed by #3669
Closed

constant folding of some builtins results in compiler panic #3363

charles-cooper opened this issue Apr 19, 2023 · 5 comments · Fixed by #3669

Comments

@charles-cooper
Copy link
Member

charles-cooper commented Apr 19, 2023

Version Information

  • vyper Version (output of vyper --version): c93bc06

What's your issue about?

repro:

BIT_MASK: constant(uint256) = shift(2**32 - 1, 224)

@external
def foo() -> uint256:
  return BIT_MASK

results in

vyper.exceptions.CompilerPanic: Node to be replaced does not exist within parent children

This is an unhandled internal compiler error. Please create an issue on Github to notify the developers.

How can it be fixed?

@charles-cooper
Copy link
Member Author

closing since shift() is deprecated as of #3019

@charles-cooper
Copy link
Member Author

note: this regression seems to have been introduced in be2c59a

@charles-cooper
Copy link
Member Author

convert is also having issues:

_BATCH_SIZE: constant(uint16) = convert(max_value(uint8), uint16))

@charles-cooper charles-cooper changed the title shift constant folding results in compiler panic constant folding of some builtins results in compiler panic May 30, 2023
@pcaversaccio
Copy link
Collaborator

convert is also having issues:

_BATCH_SIZE: constant(uint16) = convert(max_value(uint8), uint16))

the source code if needed: https://github.com/pcaversaccio/snekmate/blob/main/src/tokens/ERC1155.vy#L70

@tserg
Copy link
Collaborator

tserg commented May 31, 2023

I think convert is a separate issue because it does not have an evaluate() function for folding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants