Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
6ba13142
Commit
6ba13142
authored
Nov 02, 2013
by
Damien
Browse files
Fix bug: emit native didn't clear last_was_return in label_assign.
parent
7410e440
Changes
3
Hide whitespace changes
Inline
Side-by-side
py/emitnative.c
View file @
6ba13142
...
...
@@ -514,6 +514,7 @@ static void emit_native_delete_id(emit_t *emit, qstr qstr) {
}
static
void
emit_native_label_assign
(
emit_t
*
emit
,
int
l
)
{
emit_pre
(
emit
);
// need to commit stack because we can jump here from elsewhere
need_stack_settled
(
emit
);
#if N_X64
...
...
@@ -521,6 +522,7 @@ static void emit_native_label_assign(emit_t *emit, int l) {
#elif N_THUMB
asm_thumb_label_assign
(
emit
->
as
,
l
);
#endif
emit_post
(
emit
);
}
static
void
emit_native_import_name
(
emit_t
*
emit
,
qstr
qstr
)
{
...
...
@@ -577,8 +579,10 @@ static void emit_native_load_const_int(emit_t *emit, qstr qstr) {
}
static
void
emit_native_load_const_dec
(
emit_t
*
emit
,
qstr
qstr
)
{
// not supported for viper (although, could support floats in future)
assert
(
0
);
// for viper, a float/complex is just a Python object
emit_pre
(
emit
);
emit_call_with_imm_arg
(
emit
,
RT_F_LOAD_CONST_DEC
,
rt_load_const_dec
,
qstr
,
REG_ARG_1
);
emit_post_push_reg
(
emit
,
VTYPE_PYOBJ
,
REG_RET
);
}
static
void
emit_native_load_const_id
(
emit_t
*
emit
,
qstr
qstr
)
{
...
...
@@ -903,7 +907,7 @@ static void emit_native_setup_loop(emit_t *emit, int label) {
}
static
void
emit_native_break_loop
(
emit_t
*
emit
,
int
label
)
{
assert
(
0
);
emit_native_jump
(
emit
,
label
);
// TODO properly
}
static
void
emit_native_continue_loop
(
emit_t
*
emit
,
int
label
)
{
assert
(
0
);
...
...
py/runtime.c
View file @
6ba13142
...
...
@@ -1925,7 +1925,9 @@ py_obj_t rt_iternext(py_obj_t o_in) {
}
}
// these must correspond to the respective enum
void
*
const
rt_fun_table
[
RT_F_NUMBER_OF
]
=
{
rt_load_const_dec
,
rt_load_const_str
,
rt_load_name
,
rt_load_global
,
...
...
py/runtime.h
View file @
6ba13142
...
...
@@ -48,7 +48,8 @@ typedef enum {
}
rt_compare_op_t
;
typedef
enum
{
RT_F_LOAD_CONST_STR
=
0
,
RT_F_LOAD_CONST_DEC
=
0
,
RT_F_LOAD_CONST_STR
,
RT_F_LOAD_NAME
,
RT_F_LOAD_GLOBAL
,
RT_F_LOAD_BUILD_CLASS
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment