[cfe-dev] Bug in LocationContextManager

Ted Kremenek kremenek at apple.com
Mon Nov 2 10:59:11 PST 2009


Hi Olaf,

Other than adding clarity, this patch doesn't change program semantics:

-  void Profile(llvm::FoldingSetNodeID &ID) {
+  virtual void Profile(llvm::FoldingSetNodeID &ID) {
      Profile(ID, Kind, Ctx, Parent);
    }

Since this version of 'Profile' is defined as 'virtual' in  
llvm::FoldingSetNode, it is implicit defined as virtual in  
LocationContext.

For clarity, I've gone ahead and added the virtual keywords to these  
methods.

Ted

On Nov 2, 2009, at 8:47 AM, Olaf Krzikalla wrote:

> Hi,
>
> there seems to be a bug in LocationContextManager preventing it from  
> doing what it is IMHO supposed to do: the member variable Contexts  
> holds LocationContext (and profile them accordingly),  but the two  
> insert functions profile the actual types. Thus if getStackFrame is  
> called, always a new LocationContext is created. Making the Profile  
> method in LocationContext virtual would solve the issue. Patch  
> attached.
>
> Best
> Olaf Krzikalla
> <analysisctx.patch>_______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list