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
4dcd7cda
Commit
4dcd7cda
authored
Oct 09, 2012
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #485 from beoran/bdm_extend_main_crashes_fix
Bugfix for crash if main was extended with a module.
parents
cf2bd346
8949e3c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
src/class.c
src/class.c
+2
-0
test/t/kernel.rb
test/t/kernel.rb
+10
-0
No files found.
src/class.c
View file @
4dcd7cda
...
...
@@ -786,6 +786,8 @@ mrb_singleton_class(mrb_state *mrb, mrb_value v)
return
mrb_obj_value
(
mrb
->
false_class
);
case
MRB_TT_TRUE
:
return
mrb_obj_value
(
mrb
->
true_class
);
case
MRB_TT_MAIN
:
return
mrb_obj_value
(
mrb
->
object_class
);
case
MRB_TT_SYMBOL
:
case
MRB_TT_FIXNUM
:
case
MRB_TT_FLOAT
:
...
...
test/t/kernel.rb
View file @
4dcd7cda
...
...
@@ -204,6 +204,16 @@ assert('Kernel#extend', '15.3.1.3.13') do
a
.
respond_to?
(
:test_method
)
==
true
&&
b
.
respond_to?
(
:test_method
)
==
false
end
assert
(
'Kernel#extend works on toplevel'
,
'15.3.1.3.13'
)
do
module
Test4ExtendModule
def
test_method
;
end
end
# This would crash...
extend
(
Test4ExtendModule
)
respond_to?
(
:test_method
)
==
true
end
assert
(
'Kernel#global_variables'
,
'15.3.1.3.14'
)
do
global_variables
.
class
==
Array
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