On Thu, 4 Feb 1999, Jochen Kuepper wrote:

[Diskussion about the combo:]

 MathedInset* p;
 memcpy(&p, &array->bf[pos+1], sizeof(p));
 memcpy(&array->bf[pos+1], &p, sizeof(p));

JK> Well, if its not on the correct boundary and you access *pointer
JK> later on, it will crash !

No. Think about it.

Assume big endian.
Let bf[] = {0x10,0x20,0x30,0x40,0x50}
Let *0x20304050 = some Mathedinset struct;
Say, &bf[0] is a word boundary.
Say, pos=0.

Then &bf[pos+1] is not a word boundary.
Nevertheless you can copy bf[{1,2,3,4}] into &p.
p will point to the address 0x20304050.
*p is the Mathedinset struct;

OK?

Fred

Fred Hucht, Institute of Theoretical Physics, University of Duisburg, Germany
Email: [EMAIL PROTECTED]               http://www.thp.Uni-Duisburg.DE/
"Der Koerper der algebraischen Zahlen ist kein algebraischer Zahlkoerper"
(E. Landau, Zahlentheorie (1927), Satz 718)

Reply via email to