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
dcf6a413
Commit
dcf6a413
authored
8 years ago
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `snprintf()` to stringify fixnum numbers; fix #3492
parent
cea6a16c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
src/backtrace.c
src/backtrace.c
+6
-9
No files found.
src/backtrace.c
View file @
dcf6a413
...
...
@@ -74,14 +74,13 @@ static void
get_backtrace_i
(
mrb_state
*
mrb
,
struct
backtrace_location
*
loc
,
void
*
data
)
{
mrb_value
ary
,
str
;
int
ai
;
char
buf
[
32
];
int
ai
=
mrb_gc_arena_save
(
mrb
);
ai
=
mrb_gc_arena_save
(
mrb
);
ary
=
mrb_obj_value
((
struct
RArray
*
)
data
);
str
=
mrb_str_new_cstr
(
mrb
,
loc
->
filename
);
mrb_str_cat_lit
(
mrb
,
str
,
":"
);
mrb_str_concat
(
mrb
,
str
,
mrb_fixnum_to_str
(
mrb
,
mrb_fixnum_value
(
loc
->
lineno
),
10
));
snprintf
(
buf
,
sizeof
(
buf
),
":%d"
,
loc
->
lineno
);
if
(
loc
->
method
)
{
mrb_str_cat_lit
(
mrb
,
str
,
":in "
);
...
...
@@ -399,16 +398,14 @@ mrb_restore_backtrace(mrb_state *mrb)
int
ai
;
mrb_backtrace_entry
*
entry
;
mrb_value
mrb_entry
;
char
buf
[
32
];
ai
=
mrb_gc_arena_save
(
mrb
);
entry
=
&
(
mrb
->
backtrace
.
entries
[
i
]);
mrb_entry
=
mrb_str_new_cstr
(
mrb
,
entry
->
filename
);
mrb_str_cat_lit
(
mrb
,
mrb_entry
,
":"
);
mrb_str_concat
(
mrb
,
mrb_entry
,
mrb_fixnum_to_str
(
mrb
,
mrb_fixnum_value
(
entry
->
lineno
),
10
));
snprintf
(
buf
,
sizeof
(
buf
),
":%d"
,
entry
->
lineno
);
mrb_str_cat_cstr
(
mrb
,
mrb_entry
,
buf
);
if
(
entry
->
method_id
!=
0
)
{
mrb_str_cat_lit
(
mrb
,
mrb_entry
,
":in "
);
...
...
This diff is collapsed.
Click to expand it.
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