Fix the wrong space for static vars.

Turns out there was only one place to fix (for qc, anyway: I don't have
tests for qp yet). func-static now passes :)

Hmm, how to test for static var naming... (not implemented yet)
This commit is contained in:
Bill Currie 2012-12-04 14:25:06 +09:00
parent 6074a6648f
commit 7ccfd7b9e0

View file

@ -852,12 +852,15 @@ decl
{
specifier_t spec = $<spec>0;
type_t *type;
storage_class_t sc = $<spec>0.storage;
struct defspace_s *space = current_symtab->space;
if (!spec.type)
spec.type = type_default;
if (sc == sc_static)
space = pr.near_data;
type = find_type (append_type ($1->type, spec.type));
initialize_def ($1, type, $2, current_symtab->space,
$<spec>0.storage);
initialize_def ($1, type, $2, space, sc);
}
;