dotgnu-libjit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libjit-developers] Patch to clear block addresses


From: Evin Robertson
Subject: [Libjit-developers] Patch to clear block addresses
Date: Sun, 31 Oct 2004 11:20:25 -0500
User-agent: Mozilla Thunderbird 0.8 (X11/20040926)

If a function is restarted in a different cache page, the block addresses need to be cleared. Otherwise, in the second translation, jumps will think that they are jumping to a block which already has an address, and will jump into the previous cache block, crashing.




--- jit-function.c.~1.12.~      2004-10-03 22:26:41.000000000 -0400
+++ jit-function.c      2004-10-31 11:09:33.000000000 -0500
@@ -652,8 +652,18 @@

                /* Clear the register assignments for the first block */
                _jit_regs_init_for_block(&gen);

+
+               /* Clear addresses of each block (they may have been set
+                  to a different cache page, but are now invalid) */
+               block = 0;
+               while((block = jit_block_next(func, block)) != 0)
+               {
+                       block->address = NULL;
+                       block->fixup_list = NULL;
+               }
+
                /* Generate code for the blocks in the function */
                block = 0;
                while((block = jit_block_next(func, block)) != 0)
                {


reply via email to

[Prev in Thread] Current Thread [Next in Thread]