* src/cont.c: marked as volatile variables that we don't want optimised

away.


git-svn-id: svn://svn.zoy.org/elk/trunk@262 55e467fa-43c5-0310-a8a2-de718669efc6
This commit is contained in:
sam 2006-03-02 21:17:23 +00:00
parent 2d0bfa1171
commit c6193d0b53
1 changed files with 4 additions and 4 deletions

View File

@ -113,14 +113,14 @@ int Check_Stack_Grows_Down () {
* (the stack grows upwards on HP-PA based machines and Pyramids). * (the stack grows upwards on HP-PA based machines and Pyramids).
*/ */
unsigned int Stack_Size () { unsigned int Stack_Size () {
char foo; volatile char foo;
char *pfoo; char *pfoo = &foo;
return Stack_Grows_Down ? stkbase-pfoo : pfoo-stkbase; return Stack_Grows_Down ? stkbase-pfoo : pfoo-stkbase;
} }
void Grow_Stack (struct S_Control *cp, Object val) { void Grow_Stack (struct S_Control *cp, Object val) {
char buf[100]; volatile char buf[100];
/* Prevent the optimizer from optimizing buf away: /* Prevent the optimizer from optimizing buf away:
*/ */
@ -133,7 +133,7 @@ void Jump_Cont (struct S_Control *cp, Object val) {
static struct S_Control *p; static struct S_Control *p;
static char *from, *to; /* Must not be allocated on stack */ static char *from, *to; /* Must not be allocated on stack */
static int i; /* Ditto */ static int i; /* Ditto */
char foo; volatile char foo;
/* Reinstall the saved stack contents; take stack direction /* Reinstall the saved stack contents; take stack direction
* into account. cp must be put into a static variable, as * into account. cp must be put into a static variable, as