зеркало из https://github.com/mozilla/pjs.git
Resolve the static-analysis bustage from bug 498938 by recognizing COND_EXPR.
This commit is contained in:
Родитель
04bcf0dab6
Коммит
c63a036431
|
@ -161,6 +161,7 @@ function process_cp_pre_genericize(fndecl)
|
|||
let assign = stack[i];
|
||||
switch (TREE_CODE(assign)) {
|
||||
case VAR_DECL:
|
||||
case COND_EXPR:
|
||||
break;
|
||||
|
||||
case INIT_EXPR:
|
||||
|
|
|
@ -58,10 +58,12 @@ STACK_FAILURE_TESTCASES = \
|
|||
StackVector.cpp \
|
||||
StackConditional.cpp \
|
||||
StackAggrInit.cpp \
|
||||
StackCondBad.cpp \
|
||||
$(NULL)
|
||||
|
||||
STACK_PASS_TESTCASES = \
|
||||
StackPlacementNewOK.cpp \
|
||||
StackCond.cpp \
|
||||
$(NULL)
|
||||
|
||||
OUTPARAMS_WARNING_TESTCASES = \
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#include "nscore.h"
|
||||
|
||||
struct A
|
||||
{
|
||||
};
|
||||
|
||||
A* tfunc(int len)
|
||||
{
|
||||
A arr[5];
|
||||
A* a = len <= 5 ? arr : new A[len];
|
||||
return a;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
#include "nscore.h"
|
||||
|
||||
struct NS_STACK_CLASS A
|
||||
{
|
||||
};
|
||||
|
||||
A* tfunc(int len)
|
||||
{
|
||||
A arr[5];
|
||||
A* a = len <= 5 ? arr : new A[len];
|
||||
return a;
|
||||
}
|
|
@ -3,9 +3,7 @@ typedef int PRInt32;
|
|||
|
||||
typedef PRUint32 nsresult;
|
||||
|
||||
nsresult foo(__attribute__((user("outparam"))) int *a) {
|
||||
int x;
|
||||
|
||||
nsresult foo(nsresult x, __attribute__((user("outparam"))) int *a) {
|
||||
if (x == 0) {
|
||||
*a = 1;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче