We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Raise
Assert
vyper --version
python --version
Raise and Assert make the compiler crash if the reason string is not a memory variable.
For example, compiling:
a:String[1] @external def foo(): self.a = "a" raise self.a
leads to vyper.exceptions.CodegenPanic: unhandled exception 'int' object has no attribute 'typ', parse_Raise
vyper.exceptions.CodegenPanic: unhandled exception 'int' object has no attribute 'typ', parse_Raise
The issue comes from the fact that make_byte_array_copier is given a memory pointer and not an IR node in Stmt._assert_reason()
make_byte_array_copier
Stmt._assert_reason()
vyper/vyper/codegen/stmt.py
Lines 180 to 183 in 4b4e188
+++ b/vyper/codegen/stmt.py @@ -179,7 +179,8 @@ class Stmt: # TODO maybe use ensure_in_memory if msg_ir.location != MEMORY: buf = self.context.new_internal_variable(msg_ir.typ) - instantiate_msg = make_byte_array_copier(buf, msg_ir) + dst = IRnode.from_list(buf, typ=msg_ir.typ, location=MEMORY) + instantiate_msg = make_byte_array_copier(dst, msg_ir) else: buf = _get_last(msg_ir) if not isinstance(buf, int):
The text was updated successfully, but these errors were encountered:
KeyError
Name
assert
raise
Successfully merging a pull request may close this issue.
Version Information
vyper --version
): 4b4e188python --version
): 3.11.4What's your issue about?
Raise
andAssert
make the compiler crash if the reason string is not a memory variable.For example, compiling:
leads to
vyper.exceptions.CodegenPanic: unhandled exception 'int' object has no attribute 'typ', parse_Raise
The issue comes from the fact that
make_byte_array_copier
is given a memory pointer and not an IR node inStmt._assert_reason()
vyper/vyper/codegen/stmt.py
Lines 180 to 183 in 4b4e188
How can it be fixed?
The text was updated successfully, but these errors were encountered: