svadev AT lists.siebelschool.illinois.edu
Subject: Svadev mailing list
List archive
- From: John Criswell <criswell AT illinois.edu>
- To: Alex Miller <mille151 AT illinois.edu>, Baozeng <sploving1 AT gmail.com>
- Cc: svadev AT cs.illinois.edu
- Subject: Re: [svadev] Fwd: BBC _barebone_boundscheck function
- Date: Thu, 24 May 2012 12:54:44 -0500
- List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev>
- List-id: <svadev.cs.uiuc.edu>
- Organization: University of Illinois
|
On 5/24/12 12:35 PM, Alex Miller wrote:
2012/5/24 Baozeng <sploving1 AT gmail.com>
Hello, I cannot understand the following code in function _barebone_boundscheck defined in BaggyBoundsCheck.cpp: if (val) { if (Source & SET_MASK) { // If I understand correctly, this means that Source is OOB pointer. Source = Source & UNSET_MASK; if (Source & 0x8) {// Could you explain me why add or sub 16? Source += 16; } else { Source -= 16; } Dest = Dest & UNSET_MASK; `Source & SET_MASK` does indeed test to see if `Source`
is an OOB pointer.
Alex, can you add a comment explaining this in the code? As for the additions/subtraction, I stared at this code
before, and couldn't figure out any explanation for it.
Hopefully someone else can shed some light on it?
This code is implementing out-of-bounds pointers as described in Section 2.4 of the BBC paper. Please read this section of the paper. If it is still not clear what the code does after reading that section again, please email the list, and I will assist. 2012/5/24 Baozeng <sploving1 AT gmail.com>
Another thing, I change BBRuntime.h as the following: #if defined(i386) || defined(__i386__) #define UNSET_MASK 0xbfffffff #define SET_MASK 0xc0000000 #else #define UNSET_MASK 0x7fffffffffff #define SET_MASK 0xffff800000000000 #endif Then Dest = (Dest | SET_MASK); should works like this: if Dest = 0x891234; then after the above statement it should be 0xc0891234. But it does not work. The result is not changed, 0x891234, why? I use printf("SET_MASK is %d", SET_MASK); It prints SET_MASK is 0. any suggestion? I would guess that neither i386 nor __i386__ are defined. I
also don't recall seeing those as preprocessor defines. You
might want to throw a #warning into both parts of your #if to
see which one is being selected.
What is the size of Dest? Are you sure that you're getting SET_MASK set to 0xc0000000 as expected? I'm guessing that Dest is too small to hold the result, and so the top bits get chopped off. However, I could be wrong. Where in the code is this again? -- John T. |
- [svadev] BBC _barebone_boundscheck function, Baozeng, 05/24/2012
- Message not available
- [svadev] Fwd: BBC _barebone_boundscheck function, Baozeng, 05/24/2012
- Re: [svadev] Fwd: BBC _barebone_boundscheck function, Alex Miller, 05/24/2012
- Re: [svadev] Fwd: BBC _barebone_boundscheck function, John Criswell, 05/24/2012
- Re: [svadev] Fwd: BBC _barebone_boundscheck function, Baozeng, 05/25/2012
- Re: [svadev] Fwd: BBC _barebone_boundscheck function, John Criswell, 05/25/2012
- Re: [svadev] Fwd: BBC _barebone_boundscheck function, Baozeng, 05/26/2012
- Re: [svadev] Fwd: BBC _barebone_boundscheck function, John Criswell, 05/28/2012
- Re: [svadev] Fwd: BBC _barebone_boundscheck function, Baozeng, 05/28/2012
- Re: [svadev] Fwd: BBC _barebone_boundscheck function, John Criswell, 05/25/2012
- Re: [svadev] Fwd: BBC _barebone_boundscheck function, Baozeng, 05/25/2012
- Re: [svadev] Fwd: BBC _barebone_boundscheck function, John Criswell, 05/24/2012
- Message not available
- Message not available
- Re: [svadev] Fwd: BBC _barebone_boundscheck function, Baozeng, 05/25/2012
- Re: [svadev] Fwd: BBC _barebone_boundscheck function, John Criswell, 05/25/2012
- Re: [svadev] Fwd: BBC _barebone_boundscheck function, Baozeng, 05/26/2012
- Message not available
- Re: [svadev] Fwd: BBC _barebone_boundscheck function, Alex Miller, 05/24/2012
- [svadev] Fwd: BBC _barebone_boundscheck function, Baozeng, 05/24/2012
- Message not available
- Re: [svadev] Fwd: BBC _barebone_boundscheck function, Baozeng, 05/26/2012
Archive powered by MHonArc 2.6.16.