Mesa (glsl-pp-rework-2): glsl/pp: Add more error messages.
MichaŠKról
michal at kemper.freedesktop.org
Wed Sep 16 20:04:32 UTC 2009
Module: Mesa
Branch: glsl-pp-rework-2
Commit: de0753e4cb64792d257ad3799932a77321fc3c49
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=de0753e4cb64792d257ad3799932a77321fc3c49
Author: Michal Krol <michal at vmware.com>
Date: Wed Sep 16 20:40:02 2009 +0200
glsl/pp: Add more error messages.
---
src/glsl/pp/sl_pp_token.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/glsl/pp/sl_pp_token.c b/src/glsl/pp/sl_pp_token.c
index 68c8fbe..95fe4f7 100644
--- a/src/glsl/pp/sl_pp_token.c
+++ b/src/glsl/pp/sl_pp_token.c
@@ -47,6 +47,7 @@ _tokenise_identifier(struct sl_pp_context *context,
(*input >= '0' && *input <= '9') ||
(*input == '_')) {
if (i >= sizeof(identifier) - 1) {
+ strcpy(context->error_msg, "out of memory");
return -1;
}
identifier[i++] = *input++;
@@ -85,6 +86,7 @@ _tokenise_number(struct sl_pp_context *context,
(*input == '-') ||
(*input == '.')) {
if (i >= sizeof(number) - 1) {
+ strcpy(context->error_msg, "out of memory");
return -1;
}
number[i++] = *input++;
@@ -384,6 +386,7 @@ sl_pp_tokenise(struct sl_pp_context *context,
out = realloc(out, new_max * sizeof(struct sl_pp_token_info));
if (!out) {
+ strcpy(context->error_msg, "out of memory");
return -1;
}
out_max = new_max;
More information about the mesa-commit
mailing list