Hi all,
when use the 'gccjit::struct_' with default constructor, just like:
gccjit::struct_ a;
it will crash with error: gcc_jit_type_as_object: NULL type. terminate called
after throwing an instance of 'gccjit::error'
because 'struct_' pass a NULL to 'type'. and 'type' call gcc_jit_type_as_object.
inline struct_::struct_ () : type (NULL) {}
inline type::type (gcc_jit_type *inner)
: object (gcc_jit_type_as_object (inner))
{}
OK to commit?
Best regards,
Xin Zhao
---
gcc/jit/libgccjit++.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/jit/libgccjit++.h b/gcc/jit/libgccjit++.h
index 7ecd915cddb..8a8625f8653 100644
--- a/gcc/jit/libgccjit++.h
+++ b/gcc/jit/libgccjit++.h
@@ -1450,7 +1450,7 @@ type::one ()
}
// class struct_
-inline struct_::struct_ () : type (NULL) {}
+inline struct_::struct_ () : type () {}
inline struct_::struct_ (gcc_jit_struct *inner) :
type (gcc_jit_struct_as_type (inner))
{
--
2.27.0