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
1c66d42e
Unverified
Commit
1c66d42e
authored
Apr 25, 2018
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Apr 25, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4010 from take-cheeze/fix_ary_replace_leak
Fix array replace leak error in mruby-uri.
parents
8bfad558
e66c9902
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
src/array.c
src/array.c
+3
-0
test/t/array.rb
test/t/array.rb
+7
-0
No files found.
src/array.c
View file @
1c66d42e
...
...
@@ -377,6 +377,9 @@ ary_replace(mrb_state *mrb, struct RArray *a, struct RArray *b)
if
(
ARY_EMBED_P
(
a
))
{
ARY_UNSET_EMBED_FLAG
(
a
);
}
else
{
mrb_free
(
mrb
,
a
->
as
.
heap
.
ptr
);
}
a
->
as
.
heap
.
ptr
=
b
->
as
.
heap
.
ptr
;
a
->
as
.
heap
.
len
=
len
;
a
->
as
.
heap
.
aux
.
shared
=
b
->
as
.
heap
.
aux
.
shared
;
...
...
test/t/array.rb
View file @
1c66d42e
...
...
@@ -392,3 +392,10 @@ assert('Array#freeze') do
a
[
0
]
=
1
end
end
assert
(
'shared array replace'
)
do
a
=
[
0
]
*
40
b
=
[
0
,
1
,
2
]
b
.
replace
a
[
1
,
20
].
dup
assert_equal
20
,
b
.
size
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