summaryrefslogtreecommitdiffstats
path: root/src/intel/common/gen_decoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/intel/common/gen_decoder.c')
-rw-r--r--src/intel/common/gen_decoder.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c
index 50ef2c4204f..90b0f97965f 100644
--- a/src/intel/common/gen_decoder.c
+++ b/src/intel/common/gen_decoder.c
@@ -697,7 +697,7 @@ gen_spec_load_from_path(const struct gen_device_info *devinfo,
gen_spec_destroy(ctx.spec);
ctx.spec = NULL;
goto end;
- } else if (feof(input))
+ } else if (len == 0 && feof(input))
goto end;
if (XML_ParseBuffer(ctx.parser, len, len == 0) == 0) {
@@ -719,7 +719,11 @@ gen_spec_load_from_path(const struct gen_device_info *devinfo,
free(filename);
/* free ctx.spec if genxml is empty */
- if (ctx.spec && _mesa_hash_table_num_entries(ctx.spec->commands) == 0) {
+ if (ctx.spec &&
+ _mesa_hash_table_num_entries(ctx.spec->commands) == 0 &&
+ _mesa_hash_table_num_entries(ctx.spec->structs) == 0) {
+ fprintf(stderr,
+ "Error parsing XML: empty spec.\n");
gen_spec_destroy(ctx.spec);
return NULL;
}