~lsof/pez

6518bc6964e7ecb4f187dcaf789fdc3742c5bb9d — lemon 1 year, 6 months ago 6b962b5
check global decl names are not reserved
1 files changed, 3 insertions(+), 0 deletions(-)

M pez.c
M pez.c => pez.c +3 -0
@@ 3742,6 3742,9 @@ stmt(Comp *cm)
            return comperr(cm, c, "expected identifier"), 0;
        }
        TRY(readident(cm, name, sizeof name));
        if (reserved(name)) {
            return comperr(cm, *name, "'%s' is a reserved keyword", name), 0;
        }
        TRY(expectspchr(cm, '='));
        TRY(box_str(cm->cx, &key, name, strlen(name)));
        TRY(compconst(cm, key));