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
bdb9d4d1
Commit
bdb9d4d1
authored
Apr 27, 2015
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
super should not be called outside of a method; fix #2770
parent
b3b6fe3c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
src/vm.c
src/vm.c
+8
-4
No files found.
src/vm.c
View file @
bdb9d4d1
...
...
@@ -1222,6 +1222,13 @@ RETRY_TRY_BLOCK:
int
a
=
GETARG_A
(
i
);
int
n
=
GETARG_C
(
i
);
if
(
mid
==
0
)
{
mrb_value
exc
;
out_super:
exc
=
mrb_exc_new_str_lit
(
mrb
,
E_NOMETHOD_ERROR
,
"super called outside of method"
);
mrb
->
exc
=
mrb_obj_ptr
(
exc
);
goto
L_RAISE
;
}
recv
=
regs
[
0
];
c
=
mrb
->
c
->
ci
->
target_class
->
super
;
m
=
mrb_method_search_vm
(
mrb
,
&
c
,
mid
);
...
...
@@ -1306,10 +1313,7 @@ RETRY_TRY_BLOCK:
else
{
struct
REnv
*
e
=
uvenv
(
mrb
,
lv
-
1
);
if
(
!
e
)
{
mrb_value
exc
;
exc
=
mrb_exc_new_str_lit
(
mrb
,
E_NOMETHOD_ERROR
,
"super called outside of method"
);
mrb
->
exc
=
mrb_obj_ptr
(
exc
);
goto
L_RAISE
;
goto
out_super
;
}
stack
=
e
->
stack
+
1
;
}
...
...
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