From 6074a6648f1cac90ac3d799048a2643bb2258b64 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 4 Dec 2012 14:18:17 +0900 Subject: [PATCH] Do some sanity checking on storage class and defspace type. Params and locals in virtual spaces, static vars in backed. Otherwise, whatever (for now). Now func-static.r aborts :) --- tools/qfcc/source/def.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/qfcc/source/def.c b/tools/qfcc/source/def.c index b17061545..7e94314bf 100644 --- a/tools/qfcc/source/def.c +++ b/tools/qfcc/source/def.c @@ -122,6 +122,11 @@ new_def (const char *name, type_t *type, defspace_t *space, set_storage_bits (def, storage); if (space) { + if (space->type == ds_virtual && storage == sc_static) + internal_error (0, "static in a virtual space"); + if (space->type != ds_virtual + && (storage == sc_param || storage == sc_local)) + internal_error (0, "param or local in a non-virtual space"); def->space = space; *space->def_tail = def; space->def_tail = &def->next;