{
public:
tainted_allocation_size (const taint_state_machine &sm, tree arg,
+ const svalue *size_in_bytes,
enum bounds has_bounds, enum memory_space mem_space)
: taint_diagnostic (sm, arg, has_bounds),
+ m_size_in_bytes (size_in_bytes),
m_mem_space (mem_space)
{
}
}
}
+ void maybe_add_sarif_properties (sarif_object &result_obj)
+ const final override
+ {
+ taint_diagnostic::maybe_add_sarif_properties (result_obj);
+ sarif_property_bag &props = result_obj.get_or_create_properties ();
+#define PROPERTY_PREFIX "gcc/analyzer/tainted_allocation_size/"
+ props.set (PROPERTY_PREFIX "size_in_bytes", m_size_in_bytes->to_json ());
+#undef PROPERTY_PREFIX
+ }
+
private:
+ const svalue *m_size_in_bytes;
enum memory_space m_mem_space;
};
{
tree arg = get_representative_tree (size_in_bytes);
ctxt->warn (make_unique<tainted_allocation_size>
- (taint_sm, arg, b, mem_space));
+ (taint_sm, arg, size_in_bytes, b, mem_space));
}
}