Skip to content

Commit

Permalink
check resolve_tpye in inspect function (hexagonal-sun#51)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
parsa011 authored Feb 16, 2022
1 parent d467b42 commit b224d27
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/inspect.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ void inspect_external_function(tree inspect_id, tree resolved_object)

void inspect(tree inspect_id, tree resolved_object)
{
if (resolved_object == NULL) {
printf("Object not found\n");
return;
}

print_object_type(inspect_id, resolved_object);

if (is_T_LIVE_VAR(resolved_object))
Expand Down

0 comments on commit b224d27

Please sign in to comment.