mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2026-12-06 01:48:35 +00:00
Core: Refuse an expression statement whose calls would be dropped
handle_expr lowered a statement only when it was a call, and dropped any other expression with an INFO log. So `print(a) if c else print(b)` compiled to nothing at all, and failing_tests/conditionals/oneline.py passed. An expression statement that contains a call is now a compile error; one without (a docstring, a bare name) is still dropped. oneline.py becomes an IR-level xfail. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -17,6 +17,8 @@
|
||||
|
||||
"failing_tests/conditionals/struct_value.py" = {reason = "A struct value has no truth value (C rejects `if (s)`): a compile error naming the struct", level = "ir"}
|
||||
|
||||
"failing_tests/conditionals/oneline.py" = {reason = "A conditional expression used as a statement (`f() if c else g()`) is not lowered: a compile error rather than silently dropping both calls; write it as an if statement", level = "ir"}
|
||||
|
||||
"failing_tests/return_struct.py" = {reason = "Returning a struct value from an integer function is a type error (nothing to dereference to an integer)", level = "ir"}
|
||||
|
||||
"failing_tests/license.py" = {reason = "Missing LICENSE global produces IR that llc rejects — should be caught earlier with a clear error message", level = "llc"}
|
||||
|
||||
Reference in New Issue
Block a user