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
55b2e45a
Commit
55b2e45a
authored
Jan 05, 2022
by
dearblue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing keyword arguments with `super`
fix #5627
parent
d34e1cb8
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 @
55b2e45a
...
@@ -2854,8 +2854,8 @@ codegen(codegen_scope *s, node *tree, int val)
...
@@ -2854,8 +2854,8 @@ codegen(codegen_scope *s, node *tree, int val)
if
(
s2
&&
(
s2
->
ainfo
&
0x1
)
&&
tree
->
cdr
->
car
)
{
if
(
s2
&&
(
s2
->
ainfo
&
0x1
)
&&
tree
->
cdr
->
car
)
{
nk
=
gen_hash
(
s
,
tree
->
cdr
->
car
->
cdr
,
VAL
,
14
);
nk
=
gen_hash
(
s
,
tree
->
cdr
->
car
->
cdr
,
VAL
,
14
);
if
(
nk
<
0
)
{
st
++
;
nk
=
15
;}
if
(
nk
<
0
)
{
st
++
;
nk
=
15
;}
else
st
+=
nk
;
else
st
+=
nk
*
2
;
n
|=
15
<<
4
;
n
|=
nk
<<
4
;
}
}
/* block arguments */
/* block arguments */
if
(
tree
->
cdr
->
cdr
)
{
if
(
tree
->
cdr
->
cdr
)
{
...
...
src/vm.c
View file @
55b2e45a
...
@@ -1729,6 +1729,16 @@ RETRY_TRY_BLOCK:
...
@@ -1729,6 +1729,16 @@ RETRY_TRY_BLOCK:
}
}
mrb_assert
(
bidx
<
irep
->
nregs
);
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
)
{
if
(
mid
==
0
||
!
target_class
)
{
mrb_value
exc
=
mrb_exc_new_lit
(
mrb
,
E_NOMETHOD_ERROR
,
"super called outside of method"
);
mrb_value
exc
=
mrb_exc_new_lit
(
mrb
,
E_NOMETHOD_ERROR
,
"super called outside of method"
);
mrb_exc_set
(
mrb
,
exc
);
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