Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
46a6592f
Commit
46a6592f
authored
8 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py/emitglue: Refactor to remove assert(0), to improve coverage.
parent
e4af7121
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
py/emitglue.c
+4
-7
4 additions, 7 deletions
py/emitglue.c
with
4 additions
and
7 deletions
py/emitglue.c
+
4
−
7
View file @
46a6592f
...
...
@@ -126,10 +126,6 @@ mp_obj_t mp_make_function_from_raw_code(const mp_raw_code_t *rc, mp_obj_t def_ar
// make the function, depending on the raw code kind
mp_obj_t
fun
;
switch
(
rc
->
kind
)
{
case
MP_CODE_BYTECODE
:
no_other_choice:
fun
=
mp_obj_new_fun_bc
(
def_args
,
def_kw_args
,
rc
->
data
.
u_byte
.
bytecode
,
rc
->
data
.
u_byte
.
const_table
);
break
;
#if MICROPY_EMIT_NATIVE
case
MP_CODE_NATIVE_PY
:
fun
=
mp_obj_new_fun_native
(
def_args
,
def_kw_args
,
rc
->
data
.
u_native
.
fun_data
,
rc
->
data
.
u_native
.
const_table
);
...
...
@@ -144,9 +140,10 @@ mp_obj_t mp_make_function_from_raw_code(const mp_raw_code_t *rc, mp_obj_t def_ar
break
;
#endif
default:
// raw code was never set (this should not happen)
assert
(
0
);
goto
no_other_choice
;
// to help flow control analysis
// rc->kind should always be set and BYTECODE is the only remaining case
assert
(
rc
->
kind
==
MP_CODE_BYTECODE
);
fun
=
mp_obj_new_fun_bc
(
def_args
,
def_kw_args
,
rc
->
data
.
u_byte
.
bytecode
,
rc
->
data
.
u_byte
.
const_table
);
break
;
}
// check for generator functions and if so wrap in generator object
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment