www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/03/10:50:06

Date: Mon, 3 Feb 1997 17:31:00 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Pyro Technic <invid AT dmv DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: SIGSEV hates me
In-Reply-To: <32F56281.2014@dmv.com>
Message-ID: <Pine.SUN.3.91.970203172826.27184A-100000@is>
MIME-Version: 1.0

On Sun, 2 Feb 1997, Pyro Technic wrote:

> 		for(j=3; j>=0; ++j)
> 			{
> 			temp = (int)num1 % 10;
> 			digit[j]=temp;

This references digit[3], then digit[4], etc., until j overflows to be 
negative.  But even before that it overflows the stack (since digit[], 
being an automatic variable, is allocated off the stack); hence the Stack 
Fault message when it crashes.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019