I have a problem that's starting to get me frustrated. To simplify what I'm doing, I'm walking a contiguous block of memory and using a pointer along with some retyping to access the contents. The data are variable, so that's why I'm doing this.
Anyway to simplify the logic (to remove some code that acts on these variables):
The access violation occurs only sometimes on the line in bold. Right now, incptr just adds datasize to the pointer value. My first thought is that somehow what I'm doing to increment the pointer is corrupting the address so it's not quite right.
Size_decode might possibly be an issue, since there are some wierd rules on how the datasize value is represented, but the code works in about 80% of the other cases I've tried.
Any ideas on this one to solve it?
Measurement is not management.
Anyway to simplify the logic (to remove some code that acts on these variables):
Code:
currp := memrec;
datasize := size_decode(THeader(currp^).size) - 1;
repeat
incptr(currp, sizeof(THeader));
[b]move(currp^, outrec.title, datasize);[/b]
incptr(currp, datasize);
datasize := size_decode(THeader(currp^).size) - 1;
until datasize < 0;
The access violation occurs only sometimes on the line in bold. Right now, incptr just adds datasize to the pointer value. My first thought is that somehow what I'm doing to increment the pointer is corrupting the address so it's not quite right.
Size_decode might possibly be an issue, since there are some wierd rules on how the datasize value is represented, but the code works in about 80% of the other cases I've tried.
Any ideas on this one to solve it?
Measurement is not management.