Compare commits
6 commits
1.12-more-
...
appveyor-c
| Author | SHA1 | Date | |
|---|---|---|---|
| 79a686eb95 | |||
| ed3f0c4ff5 | |||
| 264cb9c65e | |||
| 099f4b2e5c | |||
| 220c641702 | |||
| 1152f3d1c4 |
5 changed files with 15 additions and 1 deletions
|
|
@ -32,7 +32,9 @@
|
||||||
void mp_arg_check_num(size_t n_args, size_t n_kw, size_t n_args_min, size_t n_args_max, bool takes_kw) {
|
void mp_arg_check_num(size_t n_args, size_t n_kw, size_t n_args_min, size_t n_args_max, bool takes_kw) {
|
||||||
// NOTE(tannewt): This prevents this function from being optimized away.
|
// NOTE(tannewt): This prevents this function from being optimized away.
|
||||||
// Without it, functions can crash when reading invalid args.
|
// Without it, functions can crash when reading invalid args.
|
||||||
|
#ifdef __GNUC__
|
||||||
__asm volatile ("");
|
__asm volatile ("");
|
||||||
|
#endif
|
||||||
// TODO maybe take the function name as an argument so we can print nicer error messages
|
// TODO maybe take the function name as an argument so we can print nicer error messages
|
||||||
|
|
||||||
if (n_kw && !takes_kw) {
|
if (n_kw && !takes_kw) {
|
||||||
|
|
|
||||||
1
py/nlr.h
1
py/nlr.h
|
|
@ -55,6 +55,7 @@ struct _nlr_buf_t {
|
||||||
#elif defined(__xtensa__)
|
#elif defined(__xtensa__)
|
||||||
void *regs[10];
|
void *regs[10];
|
||||||
#else
|
#else
|
||||||
|
#undef MICROPY_NLR_SETJMP
|
||||||
#define MICROPY_NLR_SETJMP (1)
|
#define MICROPY_NLR_SETJMP (1)
|
||||||
//#warning "No native NLR support for this arch, using setjmp implementation"
|
//#warning "No native NLR support for this arch, using setjmp implementation"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,11 @@ STATIC size_t read_uint(mp_reader_t *reader) {
|
||||||
|
|
||||||
STATIC qstr load_qstr(mp_reader_t *reader) {
|
STATIC qstr load_qstr(mp_reader_t *reader) {
|
||||||
size_t len = read_uint(reader);
|
size_t len = read_uint(reader);
|
||||||
|
#ifdef __GNUC__
|
||||||
char str[len];
|
char str[len];
|
||||||
|
#else
|
||||||
|
char *str = alloca(len);
|
||||||
|
#endif
|
||||||
read_bytes(reader, (byte*)str, len);
|
read_bytes(reader, (byte*)str, len);
|
||||||
qstr qst = qstr_from_strn(str, len);
|
qstr qst = qstr_from_strn(str, len);
|
||||||
return qst;
|
return qst;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,9 @@
|
||||||
|
|
||||||
void mp_stack_ctrl_init(void) {
|
void mp_stack_ctrl_init(void) {
|
||||||
// Force routine to not be inlined. Better guarantee than MP_NOINLINE for -flto.
|
// Force routine to not be inlined. Better guarantee than MP_NOINLINE for -flto.
|
||||||
|
#ifdef __GNUC__
|
||||||
__asm volatile ("");
|
__asm volatile ("");
|
||||||
|
#endif
|
||||||
volatile int stack_dummy;
|
volatile int stack_dummy;
|
||||||
MP_STATE_THREAD(stack_top) = (char*)&stack_dummy;
|
MP_STATE_THREAD(stack_top) = (char*)&stack_dummy;
|
||||||
}
|
}
|
||||||
|
|
@ -41,7 +43,9 @@ void mp_stack_set_top(void *top) {
|
||||||
mp_uint_t mp_stack_usage(void) {
|
mp_uint_t mp_stack_usage(void) {
|
||||||
// Assumes descending stack
|
// Assumes descending stack
|
||||||
// Force routine to not be inlined. Better guarantee than MP_NOINLINE for -flto.
|
// Force routine to not be inlined. Better guarantee than MP_NOINLINE for -flto.
|
||||||
|
#ifdef __GNUC__
|
||||||
__asm volatile ("");
|
__asm volatile ("");
|
||||||
|
#endif
|
||||||
volatile int stack_dummy;
|
volatile int stack_dummy;
|
||||||
return MP_STATE_THREAD(stack_top) - (char*)&stack_dummy;
|
return MP_STATE_THREAD(stack_top) - (char*)&stack_dummy;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -389,7 +389,10 @@ def run_tests(pyb, tests, args, base_path="."):
|
||||||
# run CPython to work out expected output
|
# run CPython to work out expected output
|
||||||
e = {"PYTHONPATH": os.getcwd(),
|
e = {"PYTHONPATH": os.getcwd(),
|
||||||
"PATH": os.environ["PATH"],
|
"PATH": os.environ["PATH"],
|
||||||
"LANG": "en_US.UTF-8"}
|
"LANG": "en_US.UTF-8",
|
||||||
|
"PYTHONIOENCODING": "utf-8"}
|
||||||
|
if 'SYSTEMROOT' in os.environ:
|
||||||
|
e['SYSTEMROOT'] = os.environ['SYSTEMROOT']
|
||||||
p = subprocess.Popen([CPYTHON3, '-B', test_file], env=e, stdout=subprocess.PIPE)
|
p = subprocess.Popen([CPYTHON3, '-B', test_file], env=e, stdout=subprocess.PIPE)
|
||||||
output_expected = b''
|
output_expected = b''
|
||||||
while p.poll() is None:
|
while p.poll() is None:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue