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
3fb20bc7
Commit
3fb20bc7
authored
Jun 14, 2012
by
Yukihiro Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BLKPUSH (and super) need to detect surrounding method scope (not block)
parent
36a1c80d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
src/codegen.c
src/codegen.c
+6
-3
No files found.
src/codegen.c
View file @
3fb20bc7
...
...
@@ -51,7 +51,8 @@ typedef struct scope {
int
sp
;
int
pc
;
int
lastlabel
;
int
ainfo
;
int
ainfo
:
15
;
int
mscope
:
1
;
struct
loopinfo
*
loop
;
int
ensure_level
;
...
...
@@ -448,6 +449,7 @@ lambda_body(codegen_scope *s, node *tree, int blk)
s
=
scope_new
(
s
->
mrb
,
s
,
tree
->
car
);
idx
=
s
->
idx
;
s
->
mscope
=
!
blk
;
if
(
blk
)
{
struct
loopinfo
*
lp
=
loop_push
(
s
,
LOOP_BLOCK
);
...
...
@@ -1346,7 +1348,7 @@ codegen(codegen_scope *s, node *tree, int val)
int
lv
=
0
,
ainfo
=
0
;
push
();
/* room for receiver */
while
(
s2
->
ainfo
<
0
)
{
while
(
!
s2
->
mscope
)
{
lv
++
;
s2
=
s2
->
prev
;
if
(
!
s2
)
break
;
...
...
@@ -1381,7 +1383,7 @@ codegen(codegen_scope *s, node *tree, int val)
int
lv
=
0
,
ainfo
=
0
;
int
n
=
0
,
sendv
=
0
;
while
(
s2
->
ainfo
<
0
)
{
while
(
!
s2
->
mscope
)
{
lv
++
;
s2
=
s2
->
prev
;
if
(
!
s2
)
break
;
...
...
@@ -1916,6 +1918,7 @@ scope_new(mrb_state *mrb, codegen_scope *prev, node *lv)
if
(
!
prev
)
return
p
;
p
->
prev
=
prev
;
p
->
ainfo
=
-
1
;
p
->
mscope
=
0
;
p
->
mrb
=
prev
->
mrb
;
p
->
icapa
=
1024
;
...
...
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