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
c308a149
Commit
c308a149
authored
Nov 19, 2018
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Hash type check for `OP_KARG` and `OP_KEY_P`; ref #4166
parent
423f872c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
src/vm.c
src/vm.c
+5
-2
No files found.
src/vm.c
View file @
c308a149
...
...
@@ -1892,7 +1892,7 @@ RETRY_TRY_BLOCK:
mrb_value
k
=
mrb_symbol_value
(
syms
[
b
]);
mrb_value
kdict
=
regs
[
mrb
->
c
->
ci
->
argc
];
if
(
!
mrb_hash_key_p
(
mrb
,
kdict
,
k
))
{
if
(
!
mrb_hash_
p
(
kdict
)
||
!
mrb_hash_
key_p
(
mrb
,
kdict
,
k
))
{
mrb_value
str
=
mrb_format
(
mrb
,
"missing keyword: %S"
,
k
);
mrb_exc_set
(
mrb
,
mrb_exc_new_str
(
mrb
,
E_ARGUMENT_ERROR
,
str
));
goto
L_RAISE
;
...
...
@@ -1905,8 +1905,11 @@ RETRY_TRY_BLOCK:
CASE
(
OP_KEY_P
,
BB
)
{
mrb_value
k
=
mrb_symbol_value
(
syms
[
b
]);
mrb_value
kdict
=
regs
[
mrb
->
c
->
ci
->
argc
];
mrb_bool
key_p
=
mrb_hash_key_p
(
mrb
,
kdict
,
k
)
;
mrb_bool
key_p
=
FALSE
;
if
(
mrb_hash_p
(
kdict
))
{
key_p
=
mrb_hash_key_p
(
mrb
,
kdict
,
k
);
}
regs
[
a
]
=
mrb_bool_value
(
key_p
);
NEXT
;
}
...
...
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