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
c794d1c4
Commit
c794d1c4
authored
Nov 22, 2012
by
Daniel Bovensiepen
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into mrbgems
parents
953cbff6
276b7702
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
src/vm.c
src/vm.c
+17
-3
test/t/float.rb
test/t/float.rb
+1
-1
No files found.
src/vm.c
View file @
c794d1c4
...
...
@@ -151,14 +151,27 @@ uvset(mrb_state *mrb, int up, int idx, mrb_value v)
mrb_write_barrier
(
mrb
,
(
struct
RBasic
*
)
e
);
}
static
inline
int
is_strict
(
mrb_state
*
mrb
,
struct
REnv
*
e
)
{
int
cioff
=
e
->
cioff
;
if
(
cioff
>=
0
&&
mrb
->
cibase
[
cioff
].
proc
&&
MRB_PROC_STRICT_P
(
mrb
->
cibase
[
cioff
].
proc
))
{
return
1
;
}
return
0
;
}
struct
REnv
*
top_env
(
struct
RProc
*
proc
)
top_env
(
mrb_state
*
mrb
,
struct
RProc
*
proc
)
{
struct
REnv
*
e
=
proc
->
env
;
if
(
is_strict
(
mrb
,
e
))
return
e
;
while
(
e
->
c
)
{
if
(
!
e
)
return
0
;
e
=
(
struct
REnv
*
)
e
->
c
;
if
(
is_strict
(
mrb
,
e
))
return
e
;
}
return
e
;
}
...
...
@@ -1165,8 +1178,9 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
break
;
case
OP_R_RETURN
:
if
(
!
proc
->
env
)
goto
NORMAL_RETURN
;
if
(
MRB_PROC_STRICT_P
(
proc
))
goto
NORMAL_RETURN
;
else
{
struct
REnv
*
e
=
top_env
(
proc
);
struct
REnv
*
e
=
top_env
(
mrb
,
proc
);
if
(
e
->
cioff
<
0
)
{
localjump_error
(
mrb
,
"return"
);
...
...
test/t/float.rb
View file @
c794d1c4
...
...
@@ -105,7 +105,7 @@ assert('Float#round', '15.2.9.3.12') do
i
=
3.423456789
.
round
(
3
)
a
==
3
and
b
==
4
and
c
==
3
and
d
==
-
3
and
e
==
-
4
and
f
==
12350
and
g
==
3
and
h
==
3.4
and
i
==
3.423
f
==
12350
and
g
==
3
and
check_float
(
h
,
3.4
)
and
check_float
(
i
,
3.423
)
end
assert
(
'Float#to_f'
,
'15.2.9.3.13'
)
do
...
...
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