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
0030417a
Unverified
Commit
0030417a
authored
Jan 28, 2021
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Jan 28, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5305 from dearblue/symbol0
Check first `0` when converting symbols into strings
parents
bb42c1b2
3d8a8fb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
src/symbol.c
src/symbol.c
+3
-1
No files found.
src/symbol.c
View file @
0030417a
...
...
@@ -303,6 +303,7 @@ mrb_check_intern_str(mrb_state *mrb, mrb_value str)
static
const
char
*
sym2name_len
(
mrb_state
*
mrb
,
mrb_sym
sym
,
char
*
buf
,
mrb_int
*
lenp
)
{
if
(
sym
==
0
)
goto
outofsym
;
if
(
SYMBOL_INLINE_P
(
sym
))
return
sym_inline_unpack
(
sym
,
buf
,
lenp
);
#ifndef MRB_NO_PRESYM
...
...
@@ -313,7 +314,8 @@ sym2name_len(mrb_state *mrb, mrb_sym sym, char *buf, mrb_int *lenp)
#endif
sym
-=
MRB_PRESYM_MAX
;
if
(
sym
==
0
||
mrb
->
symidx
<
sym
)
{
if
(
mrb
->
symidx
<
sym
)
{
outofsym:
if
(
lenp
)
*
lenp
=
0
;
return
NULL
;
}
...
...
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