Thread View: comp.os.ms-windows.programmer.memory
2 messages
2 total messages
Started by lorbeyal
Thu, 03 Aug 1995 05:17
A BUG in MSVC 1.5 ???
Author: lorbeyal
Date: Thu, 03 Aug 1995 05:17
Date: Thu, 03 Aug 1995 05:17
78 lines
2855 bytes
2855 bytes
I want to interduce to you something that might be a bug
in the msvc 1.5 compiler: The comiler don't give enouth room
for a big array, and step over the next vatiables in class.
I deliver this also to the c group, because it's basicly a
c problem.
This is my object definition:
#define pdVERTEX_ENTRY 10
#define pdNUM_VERTICES 512
#define pdMAX_VERTICES 300
#define pdSTOP_FLAG -5
#define pdRE_EMPTY -1
typedef MlV3d VArr[pdNUM_VERTICES];
typedef int VList[pdNUM_VERTICES][pdVERTEX_ENTRY];
class CVertexList : private CItemTag {
VArr vertexArray; // list of vertices coordinates
VList vertexList; // list of nigbers vertices
VList polygonList; // list of polygons neigbers
long maxVertices; // max vertices to set in place
long status;
ect...
This is a part of my initialization function:
long CVertexList::RestartVerlist ()
// restart the database
{
RestartItemtag();
for (int i=0; i<pdVERTEX_ENTRY; i++)
for (int j=0; j<pdNUM_VERTICES; j++) {
vertexList[j][i] = 0;
if (maxVertices != pdMAX_VERTICES) // debugging line #1
Error();
polygonList[j][i] = 0;
if (maxVertices != pdMAX_VERTICES) // debugging line #2
Error();
}
if (maxVertices>=pdNUM_VERTICES)
return 0;
ect...
Breakpoint are set on the two lines contains the Error function.
We shoudent actualy get into there...
The second breakpoint is activated and the data are set like this
(taken from the watch window):
maxVertices = 0
i = 8
j = 511
+&polygonList[j][i] = 0x3497:0x80FA
+&maxVertices = 0x3497:0x80FA
+&polygonList[0][0] = 0x3497:0x58FE
status = -842150451
+&status = 0x3497:0x80FE
Note that if the array 'polygonList' starts at Adress 0x58fe then
the next variable shoud be set at least at 0x80fe, the next variable
('maxVertices') starts at adress 0x80fa, four bytes too erly.
I must say that this code was working well, After some changes, which done
in other places this bug appeared.
Is something wrong whith my programming? Is it a compiler bug, or what?
What can i do to deal whith this phenomena in the future?
---
Eyal Lorberboim
lorbeyal@netvision.net.il
Re: A BUG in MSVC 1.5 ???
Author: Erich W. Einfalt
Date: Fri, 04 Aug 1995 02:04
Date: Fri, 04 Aug 1995 02:04
89 lines
3336 bytes
3336 bytes
In article <NEWTNews.1192.807427460.lorbeyal@Mercury.Netvision.net.il> lorbeyal@netvision.net.il writes:
>From: lorbeyal@netvision.net.il
>Subject: A BUG in MSVC 1.5 ???
>Date: Wed, 02 Aug 95 22:17:17 PDT
>I want to interduce to you something that might be a bug
>in the msvc 1.5 compiler: The comiler don't give enouth room
>for a big array, and step over the next vatiables in class.
>I deliver this also to the c group, because it's basicly a
>c problem.
>This is my object definition:
>#define pdVERTEX_ENTRY 10
>#define pdNUM_VERTICES 512
>#define pdMAX_VERTICES 300
>#define pdSTOP_FLAG -5
>#define pdRE_EMPTY -1
>typedef MlV3d VArr[pdNUM_VERTICES];
>typedef int VList[pdNUM_VERTICES][pdVERTEX_ENTRY];
>class CVertexList : private CItemTag {
> VArr vertexArray; // list of vertices coordinates
> VList vertexList; // list of nigbers vertices
> VList polygonList; // list of polygons neigbers
> long maxVertices; // max vertices to set in place
> long status;
>
>ect...
>This is a part of my initialization function:
>long CVertexList::RestartVerlist ()
>// restart the database
>{
> RestartItemtag();
> for (int i=0; i<pdVERTEX_ENTRY; i++)
> for (int j=0; j<pdNUM_VERTICES; j++) {
> vertexList[j][i] = 0;
> if (maxVertices != pdMAX_VERTICES) // debugging line #1
> Error();
> polygonList[j][i] = 0;
> if (maxVertices != pdMAX_VERTICES) // debugging line #2
> Error();
> }
> if (maxVertices>=pdNUM_VERTICES)
> return 0;
>
>ect...
>Breakpoint are set on the two lines contains the Error function.
>We shoudent actualy get into there...
>The second breakpoint is activated and the data are set like this
> (taken from the watch window):
> maxVertices = 0
> i = 8
> j = 511
>+&polygonList[j][i] = 0x3497:0x80FA
>+&maxVertices = 0x3497:0x80FA
>+&polygonList[0][0] = 0x3497:0x58FE
> status = -842150451
>+&status = 0x3497:0x80FE
>Note that if the array 'polygonList' starts at Adress 0x58fe then
>the next variable shoud be set at least at 0x80fe, the next variable
>('maxVertices') starts at adress 0x80fa, four bytes too erly.
>I must say that this code was working well, After some changes, which done
>in other places this bug appeared.
>Is something wrong whith my programming? Is it a compiler bug, or what?
>What can i do to deal whith this phenomena in the future?
>---
>Eyal Lorberboim
>lorbeyal@netvision.net.il
The July issue of Window/DOS Developer's Journal exposes a Micorsoft confirmed
bug in VC++ v1.5 regarding defective code generation with regards to certain
operations involving long ints. Check it out.
ewe@genesis.net
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads