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
11955ca1
Unverified
Commit
11955ca1
authored
Jun 25, 2020
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call `#initialize_copy` from `init_copy` only if it's redefined.
parent
52dd0a8c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
src/kernel.c
src/kernel.c
+5
-1
No files found.
src/kernel.c
View file @
11955ca1
...
...
@@ -283,6 +283,8 @@ copy_class(mrb_state *mrb, mrb_value dst, mrb_value src)
MRB_SET_INSTANCE_TT
(
dc
,
MRB_INSTANCE_TT
(
sc
));
}
static
mrb_value
mrb_obj_init_copy
(
mrb_state
*
mrb
,
mrb_value
self
);
static
void
init_copy
(
mrb_state
*
mrb
,
mrb_value
dest
,
mrb_value
obj
)
{
...
...
@@ -310,7 +312,9 @@ init_copy(mrb_state *mrb, mrb_value dest, mrb_value obj)
default:
break
;
}
if
(
!
mrb_func_basic_p
(
mrb
,
dest
,
MRB_SYM
(
initialize_copy
),
mrb_obj_init_copy
))
{
mrb_funcall_id
(
mrb
,
dest
,
MRB_SYM
(
initialize_copy
),
1
,
obj
);
}
}
/* 15.3.1.3.8 */
...
...
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