From 3894b38af99b952766048d8e78080a67a8bc7b0c Mon Sep 17 00:00:00 2001 From: johanknol Date: Mon, 27 Jan 2003 09:36:26 +0000 Subject: [PATCH] fixed bug #613764 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2185 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCC.y | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/SDCC.y b/src/SDCC.y index adf00af5..44ef82b9 100644 --- a/src/SDCC.y +++ b/src/SDCC.y @@ -1102,9 +1102,13 @@ type_name /* go to the end of the list */ sym_link *p; pointerTypes($2,$1); - for ( p = $2 ; p->next ; p=p->next); - p->next = $1 ; - $$ = $2 ; + for ( p = $2 ; p && p->next ; p=p->next); + if (!p) { + werror(E_SYNTAX_ERROR, yytext); + } else { + p->next = $1 ; + } + $$ = $2 ; } ; -- 2.39.5