summaryrefslogtreecommitdiff
path: root/src/glsl/pp/sl_pp_extension.c
diff options
context:
space:
mode:
authorVinson Lee <vlee@vmware.com>2010-02-15 00:30:31 -0800
committerVinson Lee <vlee@vmware.com>2010-02-15 00:30:31 -0800
commitf0e1499805eb98e4d6dfe4f95f601593c65044d6 (patch)
tree61383eb6d6329dcd3e41881fbc5fbf93f1e48b04 /src/glsl/pp/sl_pp_extension.c
parent6536cdf1836a302d334f7380d1723e8f0bc396be (diff)
glsl/pp: Add asserts to check for null pointer deferences.
Diffstat (limited to 'src/glsl/pp/sl_pp_extension.c')
-rw-r--r--src/glsl/pp/sl_pp_extension.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glsl/pp/sl_pp_extension.c b/src/glsl/pp/sl_pp_extension.c
index 2b6cf3c7e4..677fb8a0e6 100644
--- a/src/glsl/pp/sl_pp_extension.c
+++ b/src/glsl/pp/sl_pp_extension.c
@@ -137,6 +137,7 @@ sl_pp_process_extension(struct sl_pp_context *context,
return -1;
}
out.token = SL_PP_EXTENSION_REQUIRE;
+ assert(extension);
extension->enabled = 1;
} else if (behavior == context->dict.enable) {
if (out.data.extension == -1) {
@@ -148,6 +149,7 @@ sl_pp_process_extension(struct sl_pp_context *context,
return -1;
}
out.token = SL_PP_EXTENSION_ENABLE;
+ assert(extension);
extension->enabled = 1;
} else if (behavior == context->dict.warn) {
if (out.data.extension == -1) {
@@ -155,6 +157,7 @@ sl_pp_process_extension(struct sl_pp_context *context,
return 0;
}
out.token = SL_PP_EXTENSION_WARN;
+ assert(extension);
extension->enabled = 1;
} else if (behavior == context->dict.disable) {
if (out.data.extension == -1) {
@@ -162,6 +165,7 @@ sl_pp_process_extension(struct sl_pp_context *context,
return 0;
}
out.token = SL_PP_EXTENSION_DISABLE;
+ assert(extension);
extension->enabled = 0;
} else {
strcpy(context->error_msg, "unrecognised behavior name");