Skip to content

Commit 3dad2cb

Browse files
authored
Merge pull request adafruit#9 from jepler/1.13_test_fixes
1.13 test fixes
2 parents f0bb26d + 716a82b commit 3dad2cb

File tree

18 files changed

+141
-89
lines changed

18 files changed

+141
-89
lines changed

examples/natmod/features0/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Location of top-level MicroPython directory
2+
MPY_DIR = ../../..
3+
4+
# Name of module
5+
MOD = features0
6+
7+
# Source files (.c or .py)
8+
SRC = features0.c
9+
10+
# Architecture to build for (x86, x64, armv7m, xtensa, xtensawin)
11+
ARCH = x64
12+
13+
# Include to get the rules for compiling and linking the module
14+
include $(MPY_DIR)/py/dynruntime.mk

examples/natmod/features0/features0.c

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* This example demonstrates the following features in a native module:
2+
- defining a simple function exposed to Python
3+
- defining a local, helper C function
4+
- getting and creating integer objects
5+
*/
6+
7+
// Include the header file to get access to the MicroPython API
8+
#include "py/dynruntime.h"
9+
10+
// Helper function to compute factorial
11+
STATIC mp_int_t factorial_helper(mp_int_t x) {
12+
if (x == 0) {
13+
return 1;
14+
}
15+
return x * factorial_helper(x - 1);
16+
}
17+
18+
// This is the function which will be called from Python, as factorial(x)
19+
STATIC mp_obj_t factorial(mp_obj_t x_obj) {
20+
// Extract the integer from the MicroPython input object
21+
mp_int_t x = mp_obj_get_int(x_obj);
22+
// Calculate the factorial
23+
mp_int_t result = factorial_helper(x);
24+
// Convert the result to a MicroPython integer object and return it
25+
return mp_obj_new_int(result);
26+
}
27+
// Define a Python reference to the function above
28+
STATIC MP_DEFINE_CONST_FUN_OBJ_1(factorial_obj, factorial);
29+
30+
// This is the entry point and is called when the module is imported
31+
mp_obj_t mpy_init(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_obj_t *args) {
32+
// This must be first, it sets up the globals dict and other things
33+
MP_DYNRUNTIME_INIT_ENTRY
34+
35+
// Make the function available in the module's namespace
36+
mp_store_global(MP_QSTR_factorial, MP_OBJ_FROM_PTR(&factorial_obj));
37+
38+
// This must be last, it restores the globals dict
39+
MP_DYNRUNTIME_INIT_EXIT
40+
}

extmod/modframebuf.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ STATIC const mp_obj_type_t mp_type_framebuf;
294294
static mp_obj_framebuf_t *native_framebuf(mp_obj_t framebuf_obj) {
295295
mp_obj_t native_framebuf = mp_obj_cast_to_native_base(framebuf_obj, &mp_type_framebuf);
296296
mp_obj_assert_native_inited(native_framebuf);
297+
if (native_framebuf == MP_OBJ_NULL) {
298+
mp_raise_TypeError(NULL);
299+
}
297300
return MP_OBJ_TO_PTR(native_framebuf);
298301
}
299302

extmod/modure.c

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,13 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(re_split_obj, 2, 3, re_split);
272272

273273
#if MICROPY_PY_URE_SUB
274274

275-
STATIC mp_obj_t re_sub_helper(mp_obj_t self_in, size_t n_args, const mp_obj_t *args) {
276-
mp_obj_re_t *self = MP_OBJ_TO_PTR(self_in);
275+
STATIC mp_obj_t re_sub_helper(size_t n_args, const mp_obj_t *args) {
276+
mp_obj_re_t *self;
277+
if (mp_obj_is_type(args[0], &re_type)) {
278+
self = MP_OBJ_TO_PTR(args[0]);
279+
} else {
280+
self = MP_OBJ_TO_PTR(mod_re_compile(1, args));
281+
}
277282
mp_obj_t replace = args[1];
278283
mp_obj_t where = args[2];
279284
mp_int_t count = 0;
@@ -377,10 +382,7 @@ STATIC mp_obj_t re_sub_helper(mp_obj_t self_in, size_t n_args, const mp_obj_t *a
377382
return mp_obj_new_str_from_vstr(mp_obj_get_type(where), &vstr_return);
378383
}
379384

380-
STATIC mp_obj_t re_sub(size_t n_args, const mp_obj_t *args) {
381-
return re_sub_helper(args[0], n_args, args);
382-
}
383-
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(re_sub_obj, 3, 5, re_sub);
385+
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(re_sub_obj, 3, 5, re_sub_helper);
384386

385387
#endif
386388

@@ -439,33 +441,6 @@ STATIC mp_obj_t mod_re_compile(size_t n_args, const mp_obj_t *args) {
439441
}
440442
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_re_compile_obj, 1, 2, mod_re_compile);
441443

442-
STATIC mp_obj_t mod_re_exec(bool is_anchored, uint n_args, const mp_obj_t *args) {
443-
(void)n_args;
444-
mp_obj_t self = mod_re_compile(1, args);
445-
446-
const mp_obj_t args2[] = {self, args[1]};
447-
mp_obj_t match = ure_exec(is_anchored, 2, args2);
448-
return match;
449-
}
450-
451-
STATIC mp_obj_t mod_re_match(size_t n_args, const mp_obj_t *args) {
452-
return mod_re_exec(true, n_args, args);
453-
}
454-
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_re_match_obj, 2, 4, mod_re_match);
455-
456-
STATIC mp_obj_t mod_re_search(size_t n_args, const mp_obj_t *args) {
457-
return mod_re_exec(false, n_args, args);
458-
}
459-
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_re_search_obj, 2, 4, mod_re_search);
460-
461-
#if MICROPY_PY_URE_SUB
462-
STATIC mp_obj_t mod_re_sub(size_t n_args, const mp_obj_t *args) {
463-
mp_obj_t self = mod_re_compile(1, args);
464-
return re_sub_helper(MP_OBJ_TO_PTR(self), n_args, args);
465-
}
466-
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_re_sub_obj, 3, 5, mod_re_sub);
467-
#endif
468-
469444
#if !MICROPY_ENABLE_DYNRUNTIME
470445
STATIC const mp_rom_map_elem_t mp_module_re_globals_table[] = {
471446
#if CIRCUITPY
@@ -474,10 +449,10 @@ STATIC const mp_rom_map_elem_t mp_module_re_globals_table[] = {
474449
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_ure) },
475450
#endif
476451
{ MP_ROM_QSTR(MP_QSTR_compile), MP_ROM_PTR(&mod_re_compile_obj) },
477-
{ MP_ROM_QSTR(MP_QSTR_match), MP_ROM_PTR(&mod_re_match_obj) },
478-
{ MP_ROM_QSTR(MP_QSTR_search), MP_ROM_PTR(&mod_re_search_obj) },
452+
{ MP_ROM_QSTR(MP_QSTR_match), MP_ROM_PTR(&re_match_obj) },
453+
{ MP_ROM_QSTR(MP_QSTR_search), MP_ROM_PTR(&re_search_obj) },
479454
#if MICROPY_PY_URE_SUB
480-
{ MP_ROM_QSTR(MP_QSTR_sub), MP_ROM_PTR(&mod_re_sub_obj) },
455+
{ MP_ROM_QSTR(MP_QSTR_sub), MP_ROM_PTR(&re_sub_obj) },
481456
#endif
482457
#if MICROPY_PY_URE_DEBUG
483458
{ MP_ROM_QSTR(MP_QSTR_DEBUG), MP_ROM_INT(FLAG_DEBUG) },

extmod/re1.5/compilecode.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ static const char *_compilecode(const char *re, ByteProg *prog, int sizecode)
8787
PC++; // Skip # of pair byte
8888
prog->len++;
8989
for (cnt = 0; *re != ']'; re++, cnt++) {
90-
if (*re == '\\') {
91-
++re;
92-
}
9390
if (!*re) return NULL;
9491
const char *b = re;
9592
if (*re == '\\') {

locale/circuitpython.pot

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,10 @@ msgstr ""
663663
msgid "Cannot specify RTS or CTS in RS485 mode"
664664
msgstr ""
665665

666+
#: py/objslice.c
667+
msgid "Cannot subclass slice"
668+
msgstr ""
669+
666670
#: shared-module/bitbangio/SPI.c
667671
msgid "Cannot transfer without MOSI and MISO pins."
668672
msgstr ""
@@ -3886,10 +3890,14 @@ msgstr ""
38863890
msgid "sleep length must be non-negative"
38873891
msgstr ""
38883892

3889-
#: extmod/ulab/code/ndarray.c py/objslice.c
3893+
#: extmod/ulab/code/ndarray.c
38903894
msgid "slice step can't be zero"
38913895
msgstr ""
38923896

3897+
#: py/objslice.c
3898+
msgid "slice step cannot be zero"
3899+
msgstr ""
3900+
38933901
#: py/nativeglue.c
38943902
msgid "slice unsupported"
38953903
msgstr ""

ports/unix/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ include ../../py/mkenv.mk
1313
-include mpconfigport.mk
1414
include $(VARIANT_DIR)/mpconfigvariant.mk
1515

16-
# define main target
17-
PROG = micropython
16+
# This should be configured by the mpconfigvariant.mk
17+
PROG ?= micropython
1818

1919
# qstr definitions (must come before including py.mk)
2020
QSTR_DEFS = qstrdefsport.h
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Checks for regression on MP_QSTR_NULL
2+
def returns_NULL():
3+
return "NULL"

py/compile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2809,6 +2809,7 @@ STATIC void compile_atom_expr_await(compiler_t *comp, mp_parse_node_struct_t *pn
28092809
EMIT_ARG(call_method, 0, 0, 0);
28102810
EMIT_ARG(load_const_tok, MP_TOKEN_KW_NONE);
28112811
EMIT_ARG(yield, MP_EMIT_YIELD_FROM);
2812+
reserve_labels_for_native(comp, 3);
28122813
}
28132814
#endif
28142815

py/objgenerator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ STATIC mp_obj_t native_gen_wrap_call(mp_obj_t self_in, size_t n_args, size_t n_k
9090
o->base.type = &mp_type_gen_instance;
9191

9292
// Parse the input arguments and set up the code state
93+
o->coroutine_generator = self->coroutine_generator;
9394
o->pend_exc = mp_const_none;
9495
o->code_state.fun_bc = self_fun;
9596
o->code_state.ip = (const byte *)prelude_offset;

py/objslice.c

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,33 @@ STATIC void slice_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
8888
}
8989
#endif
9090

91+
#if MICROPY_PY_BUILTINS_SLICE_ATTRS
92+
STATIC mp_obj_t slice_make_new(const mp_obj_type_t *type,
93+
size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
94+
if (type != &mp_type_slice) {
95+
mp_raise_NotImplementedError(translate("Cannot subclass slice"));
96+
}
97+
// check number of arguments
98+
mp_arg_check_num(n_args, kw_args, 1, 3, false);
99+
100+
// 1st argument is the pin
101+
mp_obj_t start = mp_const_none;
102+
mp_obj_t stop = mp_const_none;
103+
mp_obj_t step = mp_const_none;
104+
if (n_args == 1) {
105+
stop = args[0];
106+
} else {
107+
start = args[0];
108+
stop = args[1];
109+
if (n_args == 3) {
110+
step = args[2];
111+
}
112+
}
113+
114+
return mp_obj_new_slice(start, stop, step);
115+
}
116+
#endif
117+
91118
#if MICROPY_PY_BUILTINS_SLICE_INDICES && !MICROPY_PY_BUILTINS_SLICE_ATTRS
92119
STATIC const mp_rom_map_elem_t slice_locals_dict_table[] = {
93120
{ MP_ROM_QSTR(MP_QSTR_indices), MP_ROM_PTR(&slice_indices_obj) },
@@ -99,6 +126,9 @@ const mp_obj_type_t mp_type_slice = {
99126
{ &mp_type_type },
100127
.name = MP_QSTR_slice,
101128
.print = slice_print,
129+
#if MICROPY_PY_BUILTINS_SLICE_INDICES
130+
.make_new = slice_make_new,
131+
#endif
102132
#if MICROPY_PY_BUILTINS_SLICE_ATTRS
103133
.attr = slice_attr,
104134
#elif MICROPY_PY_BUILTINS_SLICE_INDICES
@@ -127,7 +157,7 @@ void mp_obj_slice_indices(mp_obj_t self_in, mp_int_t length, mp_bound_slice_t *r
127157
} else {
128158
step = mp_obj_get_int(self->step);
129159
if (step == 0) {
130-
mp_raise_ValueError(MP_ERROR_TEXT("slice step can't be zero"));
160+
mp_raise_ValueError(MP_ERROR_TEXT("slice step cannot be zero"));
131161
}
132162
}
133163

py/runtime.c

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,11 @@
3030
#include <string.h>
3131
#include <assert.h>
3232

33-
34-
#include "extmod/vfs.h"
35-
3633
#include "py/parsenum.h"
3734
#include "py/compile.h"
3835
#include "py/mperrno.h"
3936
#include "py/objstr.h"
4037
#include "py/objtuple.h"
41-
#include "py/objtype.h"
4238
#include "py/objlist.h"
4339
#include "py/objtype.h"
4440
#include "py/objmodule.h"
@@ -1066,27 +1062,27 @@ void mp_convert_member_lookup(mp_obj_t self, const mp_obj_type_t *type, mp_obj_t
10661062
}
10671063
dest[0] = ((mp_obj_static_class_method_t *)MP_OBJ_TO_PTR(member))->fun;
10681064
dest[1] = MP_OBJ_FROM_PTR(type);
1065+
#if MICROPY_PY_BUILTINS_PROPERTY
1066+
// If self is MP_OBJ_NULL, we looking at the class itself, not an instance.
1067+
} else if (mp_obj_is_type(member, &mp_type_property) && mp_obj_is_native_type(type) && self != MP_OBJ_NULL) {
1068+
// object member is a property; delegate the load to the property
1069+
// Note: This is an optimisation for code size and execution time.
1070+
// The proper way to do it is have the functionality just below
1071+
// in a __get__ method of the property object, and then it would
1072+
// be called by the descriptor code down below. But that way
1073+
// requires overhead for the nested mp_call's and overhead for
1074+
// the code.
1075+
const mp_obj_t *proxy = mp_obj_property_get(member);
1076+
if (proxy[0] == mp_const_none) {
1077+
mp_raise_AttributeError(translate("unreadable attribute"));
1078+
} else {
1079+
dest[0] = mp_call_function_n_kw(proxy[0], 1, 0, &self);
1080+
}
1081+
#endif
10691082
} else {
10701083
// `member` is a value, so just return that value.
10711084
dest[0] = member;
10721085
}
1073-
#if MICROPY_PY_BUILTINS_PROPERTY
1074-
// If self is MP_OBJ_NULL, we looking at the class itself, not an instance.
1075-
} else if (mp_obj_is_type(member, &mp_type_property) && mp_obj_is_native_type(type) && self != MP_OBJ_NULL) {
1076-
// object member is a property; delegate the load to the property
1077-
// Note: This is an optimisation for code size and execution time.
1078-
// The proper way to do it is have the functionality just below
1079-
// in a __get__ method of the property object, and then it would
1080-
// be called by the descriptor code down below. But that way
1081-
// requires overhead for the nested mp_call's and overhead for
1082-
// the code.
1083-
const mp_obj_t *proxy = mp_obj_property_get(member);
1084-
if (proxy[0] == mp_const_none) {
1085-
mp_raise_AttributeError(translate("unreadable attribute"));
1086-
} else {
1087-
dest[0] = mp_call_function_n_kw(proxy[0], 1, 0, &self);
1088-
}
1089-
#endif
10901086
} else {
10911087
// `member` is a value, so just return that value.
10921088
dest[0] = member;

py/stream.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,4 +576,7 @@ int mp_stream_posix_fsync(mp_obj_t stream) {
576576
return res;
577577
}
578578

579+
const mp_stream_p_t *mp_get_stream(mp_const_obj_t self) {
580+
return mp_proto_get(MP_QSTR_protocol_stream, self);
581+
}
579582
#endif

py/stream.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@ MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_ioctl_obj);
9999
#define MP_STREAM_OP_IOCTL (4)
100100

101101
// Object is assumed to have a non-NULL stream protocol with valid r/w/ioctl methods
102-
static inline const mp_stream_p_t *mp_get_stream(mp_const_obj_t self) {
103-
return mp_proto_get(MP_QSTR_protocol_stream, self);
104-
}
102+
const mp_stream_p_t *mp_get_stream(mp_const_obj_t self);
105103

106104
const mp_stream_p_t *mp_get_stream_raise(mp_obj_t self_in, int flags);
107105
mp_obj_t mp_stream_close(mp_obj_t stream);

tests/basics/memoryview1.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,6 @@
5454
m[2] = 6
5555
print(a)
5656

57-
# invalid attribute
58-
try:
59-
memoryview(b'a').noexist
60-
except AttributeError:
61-
print('AttributeError')
62-
63-
try:
64-
m4[1:3] = m2[1:3]
65-
except ValueError:
66-
print("ValueError")
67-
68-
# invalid assignment on RHS
69-
try:
70-
memoryview(array.array('i'))[0:2] = b'1234'
71-
except ValueError:
72-
print('ValueError')
73-
7457
# invalid attribute
7558
try:
7659
memoryview(b'a').noexist

tests/micropython/import_mpy_native_gc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ def open(self, path, mode):
4949
# by the required value of sys.implementation.mpy.
5050
features0_file_contents = {
5151
# -march=x64 -mcache-lookup-bc
52-
0xB05: b'M\x05\x0b\x1f \x84b\xe9/\x00\x00\x00SH\x8b\x1ds\x00\x00\x00\xbe\x02\x00\x00\x00\xffS\x18\xbf\x01\x00\x00\x00H\x85\xc0u\x0cH\x8bC \xbe\x02\x00\x00\x00[\xff\xe0H\x0f\xaf\xf8H\xff\xc8\xeb\xe6ATUSH\x8b\x1dA\x00\x00\x00H\x8b\x7f\x08L\x8bc(A\xff\xd4H\x8d5\x1f\x00\x00\x00H\x89\xc5H\x8b\x05-\x00\x00\x00\x0f\xb78\xffShH\x89\xefA\xff\xd4H\x8b\x03[]A\\\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x84@\x12factorial\x10\x00\x00\r \x01"\x9f\x1c\x01\x1e\xff',
52+
0xB05: b'M\x05\x0b\x1f \x84b\xe9/\x00\x00\x00SH\x8b\x1ds\x00\x00\x00\xbe\x02\x00\x00\x00\xffS\x18\xbf\x01\x00\x00\x00H\x85\xc0u\x0cH\x8bC \xbe\x02\x00\x00\x00[\xff\xe0H\x0f\xaf\xf8H\xff\xc8\xeb\xe6ATUSH\x8b\x1dA\x00\x00\x00H\x8b\x7f\x08H\x8bk(\xff\xd5H\x8d5 \x00\x00\x00I\x89\xc4H\x8b\x05.\x00\x00\x00\x0f\xb78\xffShL\x89\xe7\xff\xd5H\x8b\x03[]A\\\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x84@\x12factorial \x00\x00\r \x01"\x9f\x1c\x01\x1e\xff',
5353
# -march=armv7m
54-
0x1605: b"M\x05\x16\x1f \x84\x12\x1a\xe0\x00\x00\x13\xb5\nK\nJ{D\x9cX\x02!\xe3h\x98G\x03F\x01 3\xb9\x02!#i\x01\x93\x02\xb0\xbd\xe8\x10@\x18GXC\x01;\xf4\xe7\x00\xbfj\x00\x00\x00\x00\x00\x00\x00\xf8\xb5\tN\tK~D\xf4X@hgi\xb8G\x05F\x07K\x07I\xf2XyD\x10\x88ck\x98G(F\xb8G h\xf8\xbd6\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x01\x84\x00\x12factorial\x10\x00\x00\r<\x01>\x9f8\x01:\xff",
54+
0x1605: b"M\x05\x16\x1f \x84\x12\x1a\xe0\x00\x00\x13\xb5\nK\nJ{D\x9cX\x02!\xe3h\x98G\x03F\x01 3\xb9\x02!#i\x01\x93\x02\xb0\xbd\xe8\x10@\x18GXC\x01;\xf4\xe7\x00\xbfj\x00\x00\x00\x00\x00\x00\x00\xf8\xb5\tN\tK~D\xf4X@hgi\xb8G\x05F\x07K\x07I\xf2XyD\x10\x88ck\x98G(F\xb8G h\xf8\xbd6\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x01\x84\x00\x12factorial \x00\x00\r<\x01>\x9f8\x01:\xff",
5555
}
5656

5757
# Populate other armv7m-derived archs based on armv7m.

tests/micropython/import_mpy_native_x64.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def open(self, path, mode):
9090
b'\x12' # n bytes(=4), viper code
9191
b'\x00\x00\x00\x00' # dummy machine code
9292
b'\x00' # n_qstr
93-
b'\x70' # scope_flags: VIPERBSS | VIPERRODATA | VIPERRELOC
93+
b'\x81\x60' # scope_flags: VIPERBSS | VIPERRODATA | VIPERRELOC
9494
b'\x00\x00' # n_obj, n_raw_code
9595
b'\x06rodata' # rodata, 6 bytes
9696
b'\x04' # bss, 4 bytes

0 commit comments

Comments
 (0)