Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
696589cf
Unverified
Commit
696589cf
authored
Jan 06, 2022
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Jan 06, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5628 from dearblue/super-kwargs
Fixing keyword arguments with `super`
parents
b1fc0dd5
55b2e45a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
mrbgems/mruby-compiler/core/codegen.c
mrbgems/mruby-compiler/core/codegen.c
+2
-2
src/vm.c
src/vm.c
+10
-0
No files found.
mrbgems/mruby-compiler/core/codegen.c
View file @
696589cf
...
...
@@ -2854,8 +2854,8 @@ codegen(codegen_scope *s, node *tree, int val)
if
(
s2
&&
(
s2
->
ainfo
&
0x1
)
&&
tree
->
cdr
->
car
)
{
nk
=
gen_hash
(
s
,
tree
->
cdr
->
car
->
cdr
,
VAL
,
14
);
if
(
nk
<
0
)
{
st
++
;
nk
=
15
;}
else
st
+=
nk
;
n
|=
15
<<
4
;
else
st
+=
nk
*
2
;
n
|=
nk
<<
4
;
}
/* block arguments */
if
(
tree
->
cdr
->
cdr
)
{
...
...
src/vm.c
View file @
696589cf
...
...
@@ -1729,6 +1729,16 @@ RETRY_TRY_BLOCK:
}
mrb_assert
(
bidx
<
irep
->
nregs
);
uint8_t
nk
=
(
b
>>
4
)
&
0x0f
;
if
(
nk
>
0
&&
nk
<
CALL_MAXARGS
)
{
/* pack keyword arguments */
uint8_t
n
=
b
&
0x0f
;
mrb_int
kidx
=
a
+
(
n
==
15
?
1
:
n
)
+
1
;
mrb_value
kdict
=
hash_new_from_values
(
mrb
,
nk
,
regs
+
kidx
);
regs
[
kidx
]
=
kdict
;
nk
=
15
;
b
=
n
|
(
nk
<<
4
);
}
if
(
mid
==
0
||
!
target_class
)
{
mrb_value
exc
=
mrb_exc_new_lit
(
mrb
,
E_NOMETHOD_ERROR
,
"super called outside of method"
);
mrb_exc_set
(
mrb
,
exc
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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