[cfe-dev] Sema::CurScope not initialized ??

kevinlynx kevinlynx at gmail.com
Thu Jan 10 02:01:36 PST 2013


I'm using these codes to watch scope:

        DeclContext *ctx = D->getDeclContext();  // VarDecl *D
        Scope *scope = compiler.getSema().getScopeForContext(ctx); // CompilerInstance compiler
        while (scope && scope->getParent()) {
            scope = scope->getParent();
            printf("parent scope\n");
        }

And the program crashed at getScopeForContext.  I check out the function implementation, and I found Sema::CurScope pointer has not been initialized, in my vs2010 the value is 0xcdcdcd.. What's wrong ?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130110/f4b016db/attachment.html>


More information about the cfe-dev mailing list