mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
glsl/pp: Add asserts to check for null pointer deferences.
This commit is contained in:
parent
6536cdf183
commit
f0e1499805
2 changed files with 5 additions and 0 deletions
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ sl_pp_process_get(struct sl_pp_context *context,
|
|||
int found_eof = 0;
|
||||
|
||||
if (context->process_state.out_len) {
|
||||
assert(context->process_state.out);
|
||||
*output = context->process_state.out[0];
|
||||
|
||||
if (context->process_state.out_len > 1) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue