We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc62373 commit 0151c89Copy full SHA for 0151c89
src/goto-harness/recursive_initialization.cpp
@@ -623,6 +623,17 @@ code_blockt recursive_initializationt::build_pointer_constructor(
623
624
code_blockt body{};
625
626
+ // always initalize void* pointers as NULL
627
+ if(type.subtype().id() == ID_empty)
628
+ {
629
+ null_pointer_exprt nullptr_expr{pointer_type(type.subtype())};
630
+ code_blockt null_and_return{};
631
+ code_assignt assign_null{dereference_exprt{result}, nullptr_expr};
632
+ null_and_return.add(assign_null);
633
+ null_and_return.add(code_returnt{});
634
+ return null_and_return;
635
+ }
636
+
637
// build:
638
// void type_constructor_ptr_T(int depth, T** result)
639
// {
0 commit comments