[cfe-commits] [PATCH] Fix for PR7218, and analyzer support for calloc()

Ted Kremenek kremenek at apple.com
Sun May 30 15:07:15 PDT 2010


On May 30, 2010, at 12:46 AM, Jordy Rose wrote:

> 3. LazyCompoundVal is LazyCompoundVal...i.e. I don't fully understand what
> circumstances they're used in. On the other hand, if I understand
> correctly, things with compound values should never have direct bindings
> /other/ than LazyCompoundVal.

LazyCompoundVals are used to represent assignment of compound literals or struct copies to a struct variable without having to explicitly copy the bindings, e.g.:

  struct S { int x, y; };
  ...
  struct S A = { 0, 0 };
  A.y = foo();
  ...
  struct S B = A;

In the struct copy, instead of doing a separate binding for each field of B, we just say the 'B' has the same value as 'A', but with the values of 'A' at the time of the assignment.  The "lazy" aspect is that the values for B are defined lazily by looking at the values of A.





More information about the cfe-commits mailing list