Skip to content

Commit b224d27

Browse files
authored
check resolve_tpye in inspect function (#51)
check 'resolved_type' in inspect before print info if we write '?stdout' without include stdio.h , program will crash, so we have to check resolved_type not be null
1 parent d467b42 commit b224d27

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/inspect.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ void inspect_external_function(tree inspect_id, tree resolved_object)
8888

8989
void inspect(tree inspect_id, tree resolved_object)
9090
{
91+
if (resolved_object == NULL) {
92+
printf("Object not found\n");
93+
return;
94+
}
95+
9196
print_object_type(inspect_id, resolved_object);
9297

9398
if (is_T_LIVE_VAR(resolved_object))

0 commit comments

Comments
 (0)