[6277] in Athena Bugs
dbx, Pvax, 7.1?
daemon@ATHENA.MIT.EDU (kevles@ATHENA.MIT.EDU)
Wed Oct 24 11:05:23 1990
From: kevles@ATHENA.MIT.EDU
Date: Wed, 24 Oct 90 11:05:09 -0400
To: bugs@ATHENA.MIT.EDU
Cc: dstoops@ATHENA.MIT.EDU
An olc user reports:
I have the following defined:
typedef float Matrix[4][4];
I have a function as follows:
void Mmult(a, b)
Matrix a, b;
/*
** effects: Premultiplies a by b. Result is stored in b. Matrices are 4x4.
*/
{
float t[4];
int i, j, k;
for (i=0; i<4; i++) {
t[0] = 0.0; t[1] = 0.0; t[2] = 0.0; t[3] = 0.0;
for (j=0; j<4; j++)
for (k=0; k<4; k++)
t[j] += b[i][k] * a[k][j];
b[i][0] = t[0]; b[i][1] = t[1]; b[i][2] = t[2]; b[i][3] = t[3];
}
} /* end Mmult */
When I step through this function in dbx I get the following:
(dbx) whatis a
array[0..2] of matrix.float *a;
(dbx) whatis b
array[0..2] of matrix.float *b;
!!!!! MY ARRAY HAS LOST THE FOURTH COLUMN !!!!!
He proceeded to discover that the problem lies with dbx:
I inserted some printf calls and I see the correct matrix entries.
His machine information from olc is:
CVAXSTAR, SM, 0x658000 user, 0x7e3000 (8 M) total
--Beth