From b224d2776fdfe84d02eb96a21880a9e4ceeb3065 Mon Sep 17 00:00:00 2001 From: parsa mahmoudy <43126637+parsa011@users.noreply.github.com> Date: Wed, 16 Feb 2022 11:20:04 +0330 Subject: [PATCH] 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 --- src/inspect.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/inspect.c b/src/inspect.c index 7c9010b..937dccc 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -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))