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
e673fbb3
Commit
e673fbb3
authored
Dec 03, 2016
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Dec 03, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3321 from clayton-shopify/fix-proc-crash-upstream
Fix segfault in mrb_proc_copy.
parents
d7589b10
1ff4b3f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
src/proc.c
src/proc.c
+1
-1
test/t/proc.rb
test/t/proc.rb
+16
-0
No files found.
src/proc.c
View file @
e673fbb3
...
...
@@ -140,7 +140,7 @@ mrb_proc_copy(struct RProc *a, struct RProc *b)
{
a
->
flags
=
b
->
flags
;
a
->
body
=
b
->
body
;
if
(
!
MRB_PROC_CFUNC_P
(
a
))
{
if
(
!
MRB_PROC_CFUNC_P
(
a
)
&&
a
->
body
.
irep
)
{
a
->
body
.
irep
->
refcnt
++
;
}
a
->
target_class
=
b
->
target_class
;
...
...
test/t/proc.rb
View file @
e673fbb3
...
...
@@ -163,3 +163,19 @@ assert('&obj call to_proc if defined') do
assert_raise
(
TypeError
){
mock
(
&
(
Object
.
new
))
}
end
assert
(
'initialize_copy works when initialize is removed'
)
do
begin
Proc
.
alias_method
(
:old_initialize
,
:initialize
)
Proc
.
remove_method
(
:initialize
)
a
=
Proc
.
new
{}
b
=
Proc
.
new
{}
assert_nothing_raised
do
a
.
initialize_copy
(
b
)
end
ensure
Proc
.
alias_method
(
:initialize
,
:old_initialize
)
Proc
.
remove_method
(
:old_initialize
)
end
end
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