[Bug 242277] New: gcc: improved array index checking at run time
https://bugzilla.novell.com/show_bug.cgi?id=242277 Summary: gcc: improved array index checking at run time Product: openSUSE 10.3 Version: unspecified Platform: All OS/Version: SuSE Other Status: NEW Severity: Enhancement Priority: P5 - None Component: Development AssignedTo: pth@novell.com ReportedBy: dcb314@hotmail.com QAContact: qa@suse.de Currently, gcc has no mode to check array indexes for sanity at run time. Suggest add a new compiler flag [ -fdebug ? ], which causes extra code to be generated at run time to check that the value of an array index is valid. If the array index in invalid, suggest stop the program with a suitable error message, including __FILE__ and __LINE__. So by example, int array[ 10]; void g( int); void f( int upperLimit) { for (int i = 0; i < upperLimit; ++i) { g( array[ i]); } } called by /* ... */ limit = 20; /* ... */ f( limit); then the program would stop at run time with error message Program a.out: bad array index 10 at line 1234 in file abcdef.c -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=242277 pth@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matz@novell.com Status|NEW |RESOLVED Resolution| |WONTFIX ------- Comment #1 from pth@novell.com 2007-02-05 23:45 MST ------- Please file this request upstreams at http://gcc.gnu.org/bugzilla. We will pick it up from there if and when this gets implemented. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=242277 rguenther@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|WONTFIX | ------- Comment #2 from rguenther@novell.com 2007-02-06 02:15 MST ------- This is already implemented and called -fmudflap (and variants). This is available starting from SUSE Linux 10.1 (or gcc 4.1). Reopening... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=242277 rguenther@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |INVALID ------- Comment #3 from rguenther@novell.com 2007-02-06 02:15 MST ------- .. to close as invalid. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
participants (1)
-
bugzilla_noreply@novell.com