On Mar 30, 2011, at 12:06 PM, Lenny Maiorani wrote:

> Please review attached implementation of mempcpy() checker (and commit if 
> acceptable).
> 
> -Lenny
> 
> <mempcpy-checker.diff>_______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Hi Lenny,

Minor nits:

(1) You must use spaces instead of tabs.

(2) For comments:

+       // get the length to copy

please style them as follows to follow LLVM conventions:

       // Get the length to copy.

Other than that, the main logic point I don't understand is the following code:

+  // get the value of the Dest
+  SVal destVal = state->getSVal(Dest);
+
+  // ensure the destination is not null
+  state = checkNonNull(C, state, Dest, destVal);
+  if (!state)
+    return;
+
+  // get the value of the Src
+  SVal srcVal = state->getSVal(Source);
+
+  // ensure the source is not null
+  state = checkNonNull(C, state, Source, srcVal);
+  if (!state)
+    return;
+

If either the 'Src' or 'Dest' is null, what are the right semantics?  Does 
mempcpy do nothing?  Is the return value null?  We should probably model that.

Cheers,
Ted



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to