🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.memory
Article #2

Re: A BUG in MSVC 1.5 ???

#2
From: Erich W. Einfalt
Date: Fri, 04 Aug 1995 02:04
89 lines
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
Technical Details
Message-ID: <ewe.38.0F02E9EB@genesis.net>
Path: arc1-ca.pugleaf.net!genesis.net!ewe
References: <NEWTNews.1192.807427460.lorbeyal@Mercury.Netvision.net.il>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!genesis.net!ewe
From: ewe@genesis.net (Erich W. Einfalt)
Newsgroups: comp.os.ms-windows.programmer.memory,comp.lang.c++,comp.lang.c
Subject: Re: A BUG in MSVC 1.5 ???
Date: Fri, 4 Aug 1995 02:04:55 LOCAL
Organization: SH Research
Message-ID: <ewe.38.0F02E9EB@genesis.net>
References: <NEWTNews.1192.807427460.lorbeyal@Mercury.Netvision.net.il>
NNTP-Posting-Host: ewe.genesis.net
X-Newsreader: Trumpet for Windows [Version 1.0 Rev B final beta #4]