mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2026-12-06 01:48:35 +00:00
Add null-safety check after deref_to_depth in helper_utils
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@ -111,6 +111,8 @@ def get_or_create_ptr_from_arg(
|
||||
_, expected_depth = get_base_type_and_depth(expected_type)
|
||||
if val_depth > expected_depth:
|
||||
val = deref_to_depth(func, builder, val, val_depth - expected_depth)
|
||||
if val is None:
|
||||
raise ValueError("Failed to dereference pointer to expected depth")
|
||||
|
||||
ptr, temp_name = compilation_context.scratch_pool.get_next_temp(
|
||||
local_sym_tab, expected_type
|
||||
|
||||
Reference in New Issue
Block a user