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
97761502
Commit
97761502
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 #3317 from bouk/missing-to-s
Use mrb_ptr instead of mrb_cptr in Kernel#to_s
parents
d89cfca0
9c61e1cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
src/object.c
src/object.c
+1
-1
test/t/kernel.rb
test/t/kernel.rb
+15
-0
No files found.
src/object.c
View file @
97761502
...
@@ -444,7 +444,7 @@ mrb_any_to_s(mrb_state *mrb, mrb_value obj)
...
@@ -444,7 +444,7 @@ mrb_any_to_s(mrb_state *mrb, mrb_value obj)
mrb_str_cat_lit
(
mrb
,
str
,
"#<"
);
mrb_str_cat_lit
(
mrb
,
str
,
"#<"
);
mrb_str_cat_cstr
(
mrb
,
str
,
cname
);
mrb_str_cat_cstr
(
mrb
,
str
,
cname
);
mrb_str_cat_lit
(
mrb
,
str
,
":"
);
mrb_str_cat_lit
(
mrb
,
str
,
":"
);
mrb_str_concat
(
mrb
,
str
,
mrb_ptr_to_str
(
mrb
,
mrb_
c
ptr
(
obj
)));
mrb_str_concat
(
mrb
,
str
,
mrb_ptr_to_str
(
mrb
,
mrb_ptr
(
obj
)));
mrb_str_cat_lit
(
mrb
,
str
,
">"
);
mrb_str_cat_lit
(
mrb
,
str
,
">"
);
return
str
;
return
str
;
...
...
test/t/kernel.rb
View file @
97761502
...
@@ -520,6 +520,21 @@ assert('Kernel#to_s', '15.3.1.3.46') do
...
@@ -520,6 +520,21 @@ assert('Kernel#to_s', '15.3.1.3.46') do
assert_equal
to_s
.
class
,
String
assert_equal
to_s
.
class
,
String
end
end
assert
(
'Kernel#to_s on primitives'
)
do
begin
Fixnum
.
alias_method
:to_s_
,
:to_s
Fixnum
.
remove_method
:to_s
assert_nothing_raised
do
# segfaults if mrb_cptr is used
1
.
to_s
end
ensure
Fixnum
.
alias_method
:to_s
,
:to_s_
Fixnum
.
remove_method
:to_s_
end
end
assert
(
'Kernel.local_variables'
,
'15.3.1.2.7'
)
do
assert
(
'Kernel.local_variables'
,
'15.3.1.2.7'
)
do
a
,
b
=
0
,
1
a
,
b
=
0
,
1
a
+=
b
a
+=
b
...
...
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