Inkwell causing a crash when metadata
is encountered as the type of a function argument
#546
Labels
metadata
is encountered as the type of a function argument
#546
Describe the Bug
As part of a project that ingests LLVM IR I am probing function definitions (and calls) for the types of their arguments. As my ingested IR comes from Rust (for now), it is not uncommon for me to see calls to
@llvm.dbg.declare
and the accompanying declaration.Given the
func: FunctionValue
corresponding to this declaration, callingfunc.get_type().get_param_types()
will cause a crash inBasicTypeEnum::new
with the message "Unsupported basic type: Metadata".To Reproduce
In an environment with the below things available, run
test2::run
.lib.rs
:add_min.ll
:Expected Behavior
I would have initially expected for
metadata
to be a supported type, but the fact that it isn't indicates that there is likely quite some complexity to making it so. For my use case, it would be sufficient to know that the type was metadata and avoid the crash.Ideally I would like to avoid just banning known-problematic functions from my analysis, but that is a stopgap I am considering for the moment.
LLVM Version (please complete the following information):
llvm18-0
featureDesktop (please complete the following information):
Additional Context
If there is a better way to detect usages of
metadata
in type position that doesn't eventually result in a crashing call toBasicTypeEnum::new
, I would be happy to hear about it.The text was updated successfully, but these errors were encountered: