www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - arkangath

I've posted this issue (and on bugzilla
http://d.puremagic.com/issues/show_bug.cgi?id=1190) some months ago and I still
didn't get an answer. I have reduced the problem to these four lines:

assert(myNode.rChild !is null);
assert(myNode.rNeigh.bNeigh !is myNode.rChild);
myNode.rNeigh.bNeigh=myNode.rChild;
assert(myNode.rChild !is null);

The fourth assertion fails (despite the fact that myNode.rChild is never
written to). The full code of this bug can be found at bugzilla (link above).
Any ideas how to fix this? (it's been blocking my development for months) I've
tried with all 1.x versions and with 2.0.

Dissassembled code is: (obtained with ddbg)

terrain.d:334                 assert(myNode.rChild !is null);
00403402: 8b5d08                  mov ebx, [ebp+0x8]
00403405: 8b0b                    mov ecx, [ebx]
00403407: 83790c00                cmp dword [ecx+0xc], 0x0
0040340b: 750a                    jnz 0x403417  MFKC7terrain7Terrain8TreeNodeZv
terrain.Terrain.split terrain.d:336

0040340d: b84e010000              mov eax, 0x14e
00403412: e849040000              call 0x403860 void terrain.__assert(int)
terrain.d:423
terrain.d:336                 myNode.rNeigh.bNeigh=myNode.rChild;
00403417: 8b13                    mov edx, [ebx]
00403419: 8b720c                  mov esi, [edx+0xc]
0040341c: 8b7a18                  mov edi, [edx+0x18]
0040341f: 897710                  mov [edi+0x10], esi
terrain.d:337                 assert(myNode.rChild !is null);
00403422: 8b0b                    mov ecx, [ebx]
00403424: 83790c00                cmp dword [ecx+0xc], 0x0
00403428: 750a                    jnz 0x403434  MFKC7terrain7Terrain8TreeNodeZv
terrain.Terrain.split terrain.d:337

0040342a: b851010000              mov eax, 0x151
0040342f: e82c040000              call 0x403860 void terrain.__assert(int)
terrain.d:423
00403434: eb3c                    jmp 0x403472  MFKC7terrain7Terrain8TreeNodeZv
terrain.Terrain.split terrain.d:342

terrain.d:339             else if (myNode.rNeigh.rNeigh is myNode)
myNode.rNeigh.rNeigh=myNode.rChild;
00403436: 8b5508                  mov edx, [ebp+0x8]
00403439: 8b1a                    mov ebx, [edx]
0040343b: 8b7318                  mov esi, [ebx+0x18]
0040343e: 8b4e18                  mov ecx, [esi+0x18]
00403441: 3bcb                    cmp ecx, ebx
00403443: 7510                    jnz 0x403455  MFKC7terrain7Terrain8TreeNodeZv
terrain.Terrain.split terrain.d:340

00403445: 8b4508                  mov eax, [ebp+0x8]
00403448: 8b10                    mov edx, [eax]
0040344a: 8b5a0c                  mov ebx, [edx+0xc]
0040344d: 8b7218                  mov esi, [edx+0x18]
00403450: 895e18                  mov [esi+0x18], ebx
00403453: eb1d                    jmp 0x403472  MFKC7terrain7Terrain8TreeNodeZv
terrain.Terrain.split terrain.d:342
Aug 31 2007