From e5db05b186361948ccad898c53a9b15a2d37416a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Fri, 19 Jun 2015 08:19:54 +0000 Subject: [PATCH] [COMPILER] * BUG: Don't crash when a constant is the void string. git-svn-id: svn://localhost/gambas/trunk@7144 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- main/gbc/gbc_dump.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/main/gbc/gbc_dump.c b/main/gbc/gbc_dump.c index bc162ead4..939ccd777 100644 --- a/main/gbc/gbc_dump.c +++ b/main/gbc/gbc_dump.c @@ -53,9 +53,19 @@ static const char *get_name(int index) static void get_string(int index, const char **str, int *len) { - SYMBOL *sym = TABLE_get_symbol(JOB->class->string, index); - *str = sym->name; - *len = sym->len; + SYMBOL *sym; + + if (index == VOID_STRING) + { + *str = ""; + *len = 0; + } + else + { + sym = TABLE_get_symbol(JOB->class->string, index); + *str = sym->name; + *len = sym->len; + } } static void print_quoted(FILE *file, const char *str, int len)