mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
Compare commits
2 Commits
d341cb24c0
...
c7f2955ee9
| Author | SHA1 | Date | |
|---|---|---|---|
| c7f2955ee9 | |||
| ef36ea1e03 |
@ -64,6 +64,9 @@ def handle_binary_op_impl(rval, builder, local_sym_tab):
|
||||
|
||||
def handle_binary_op(rval, builder, var_name, local_sym_tab):
|
||||
result = handle_binary_op_impl(rval, builder, local_sym_tab)
|
||||
if var_name in local_sym_tab:
|
||||
if var_name and var_name in local_sym_tab:
|
||||
logger.info(
|
||||
f"Storing result {result} into variable {local_sym_tab[var_name].var}"
|
||||
)
|
||||
builder.store(result, local_sym_tab[var_name].var)
|
||||
return result, result.type
|
||||
|
||||
@ -411,7 +411,7 @@ def process_stmt(
|
||||
raise ValueError("Failed to evaluate return expression")
|
||||
if val[1] != ret_type:
|
||||
raise ValueError(
|
||||
"Return type mismatch: expected" f"{ret_type}, got {val[1]}"
|
||||
"Return type mismatch: expected " f"{ret_type}, got {val[1]}"
|
||||
)
|
||||
builder.ret(val[0])
|
||||
did_return = True
|
||||
@ -480,6 +480,9 @@ def allocate_mem(
|
||||
continue
|
||||
var_name = target.id
|
||||
rval = stmt.value
|
||||
if var_name in local_sym_tab:
|
||||
logger.info(f"Variable {var_name} already allocated")
|
||||
continue
|
||||
if isinstance(rval, ast.Call):
|
||||
if isinstance(rval.func, ast.Name):
|
||||
call_type = rval.func.id
|
||||
|
||||
Reference in New Issue
Block a user