22*
33* Open Watcom Project
44*
5- * Copyright (c) 2002-2025 The Open Watcom Contributors. All Rights Reserved.
5+ * Copyright (c) 2002-2026 The Open Watcom Contributors. All Rights Reserved.
66* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
77*
88* ========================================================================
@@ -74,12 +74,12 @@ static void StackEntry( stack_temp *st_temp, name *temp )
7474 stack_entry * new_stk ;
7575
7676 new_stk = CGAlloc ( sizeof ( stack_entry ) );
77- new_stk -> link = StackMap ;
7877 new_stk -> size = temp -> n .size ;
7978 new_stk -> location = temp -> t .location ;
8079 new_stk -> temp .first = st_temp -> first ;
8180 new_stk -> temp .last = st_temp -> last ;
8281 new_stk -> temp .others = NULL ;
82+ new_stk -> link = StackMap ;
8383 StackMap = new_stk ;
8484}
8585
@@ -595,7 +595,7 @@ static void AssgnATemp( name *temp, block_id blk_id )
595595void FiniStackMap ( void )
596596/**************************/
597597{
598- stack_entry * next1 ;
598+ stack_entry * stack ;
599599 stack_temp * other ;
600600 stack_temp * next2 ;
601601 name * temp ;
@@ -610,13 +610,13 @@ void FiniStackMap( void )
610610 AllocNewLocal ( temp );
611611 }
612612
613- for ( ; StackMap != NULL ; StackMap = next1 ) {
614- next1 = StackMap -> link ;
615- for ( other = StackMap -> temp .others ; other != NULL ; other = next2 ) {
613+ while ( ( stack = StackMap ) != NULL ) {
614+ StackMap = StackMap -> link ;
615+ for ( other = stack -> temp .others ; other != NULL ; other = next2 ) {
616616 next2 = other -> others ;
617617 CGFree ( other );
618618 }
619- CGFree ( StackMap );
619+ CGFree ( stack );
620620 }
621621 TellTempLocs ();
622622}
0 commit comments