From efc40b7ee35b75bffb9b109dfe3224b4800c352f Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Sun, 9 Aug 2009 15:07:11 +0200 Subject: [PATCH] Avoid dereferencing a NULL pointer in the constant_pointers testcase --- Examples/test-suite/constant_pointers.i | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Examples/test-suite/constant_pointers.i b/Examples/test-suite/constant_pointers.i index 5bd2fd5..c2344fb 100644 --- a/Examples/test-suite/constant_pointers.i +++ b/Examples/test-suite/constant_pointers.i @@ -121,7 +121,8 @@ int* const globalRet2() {return &GlobalInt;} %{ static int wxEVT_COMMAND_BUTTON_CLICKEDv; -static int **wxEVT_COMMAND_BUTTON_CLICKEDp; +static int *wxEVT_COMMAND_BUTTON_CLICKEDp; +static int **wxEVT_COMMAND_BUTTON_CLICKEDpp = &wxEVT_COMMAND_BUTTON_CLICKEDp; #if defined(SWIGR) #undef lang1 /* conflicts with symbol in R internals */ #endif @@ -137,7 +138,7 @@ char *langs[] ={ lang1 }; #define EWXWEXPORT_VAR const int* wxEVENT_COMMAND_BUTTON_CLICKEDr = (int*) &wxEVT_COMMAND_BUTTON_CLICKEDv; - const int* wxEVENT_COMMAND_BUTTON_CLICKEDp = (int*) *wxEVT_COMMAND_BUTTON_CLICKEDp; + const int* wxEVENT_COMMAND_BUTTON_CLICKEDp = (int*) *wxEVT_COMMAND_BUTTON_CLICKEDpp; char **languages1 = &langs[0]; char **languages2 = (char **)&langs[0]; } -- 1.6.3.3