summaryrefslogtreecommitdiff
path: root/py/scope.c
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2024-03-26 15:23:21 +1100
committerDamien George <damien@micropython.org>2024-03-26 22:52:25 +1100
commitd694ac6e1b316ad3aaed2589eb261a52aa6e22c9 (patch)
tree58743bcb02e05fa89c3eb4d6893429ea5aee5ee3 /py/scope.c
parent57de9da35233b4120a00386c52485e68bbc931fb (diff)
py/makeqstrdata.py: Ensure that scope names get low qstr values.
Originally implemented in a patch file provided by @ironss-iotec. Fixes issue #14093. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'py/scope.c')
-rw-r--r--py/scope.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/py/scope.c b/py/scope.c
index 1a4c6cc77..4893e7cc4 100644
--- a/py/scope.c
+++ b/py/scope.c
@@ -31,6 +31,8 @@
#if MICROPY_ENABLE_COMPILER
// These low numbered qstrs should fit in 8 bits. See assertions below.
+// The (unescaped) names appear in `unsorted_str_list` in the QSTR
+// generator script py/makeqstrdata.py to ensure they are assigned low numbers.
static const uint8_t scope_simple_name_table[] = {
[SCOPE_MODULE] = MP_QSTR__lt_module_gt_,
[SCOPE_LAMBDA] = MP_QSTR__lt_lambda_gt_,