I'm using these codes to watch scope:<br><br>        DeclContext *ctx = D->getDeclContext();  // VarDecl *D<br>        Scope *scope = compiler.getSema().getScopeForContext(ctx); // CompilerInstance compiler<br>        while (scope && scope->getParent()) {<br>            scope = scope->getParent();<br>            printf("parent scope\n");<br>        }<br><br>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 ?<br><br>Thanks<br><br>