fix possible null ptr deref
fixing getInputs() to always return Input* is painful as it requires multiple inheritance
so let's keep it simple
John's fix was the right one after all, sorry
MODIFY
tools/transform.cpp
tools/transform.cpp
@@ -701,7 +701,8 @@ static void calculateAndInitConstants(Transform &t) {
num_ptrinputs = 0;
for (auto &arg : t.src.getInputs()) {
auto n = num_ptrs(arg.getType());
- if (dynamic_cast<const Input*>(&arg)->hasAttribute(ParamAttrs::ByVal)) {
+ auto in = dynamic_cast<const Input*>(&arg);
+ if (in && in->hasAttribute(ParamAttrs::ByVal)) {
num_globals_src += n;
num_globals += n;
} else

fix possible null ptr deref
fixing getInputs() to always return Input* is painful as it requires multiple inheritance
so let's keep it simple
John's fix was the right one after all, sorry