From: Ted Kremenek Date: Thu, 23 Apr 2009 17:49:43 +0000 (+0000) Subject: Fix PR 4033: the analyzer shouldn't crash on computed gotos involving symbolic X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b3cfd58c9b13325d994e5f9b5065e6a22d91911d;p=clang Fix PR 4033: the analyzer shouldn't crash on computed gotos involving symbolic target addresses. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69900 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index 4db00d2a6b..5a3f9871f7 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -763,8 +763,7 @@ void GRExprEngine::ProcessIndirectGoto(IndirectGotoNodeBuilder& builder) { } // This is really a catch-all. We don't support symbolics yet. - - assert (V.isUnknown()); + // FIXME: Implement dispatch for symbolic pointers. for (iterator I=builder.begin(), E=builder.end(); I != E; ++I) builder.generateNode(I, state); diff --git a/test/Analysis/misc-ps.m b/test/Analysis/misc-ps.m index ec0e95a465..005109fb73 100644 --- a/test/Analysis/misc-ps.m +++ b/test/Analysis/misc-ps.m @@ -249,7 +249,6 @@ void rdar_6777003(int x) { // regardless of how well the underlying StoreManager reasons about pointer // arithmetic. // - void rdar_6777209(char *p) { if (p == 0) return; @@ -260,3 +259,16 @@ void rdar_6777209(char *p) { if (p == 0) *p = 'c'; // no-warning } + +// PR 4033. A symbolic 'void *' pointer can be used as the address for a +// computed goto. +typedef void *Opcode; +Opcode pr_4033_getOpcode(); +void pr_4033(void) { +next_opcode: + { + Opcode op = pr_4033_getOpcode(); + if (op) goto *op; + } +} +