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
99af3183
Commit
99af3183
authored
Mar 29, 2013
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1115 from monaka/pr-add-null-char-to-each-symbol-name
Add null char terminate to each symbol name.
parents
6818ec0b
a9f24733
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
src/dump.c
src/dump.c
+2
-1
src/load.c
src/load.c
+1
-1
No files found.
src/dump.c
View file @
99af3183
...
...
@@ -166,7 +166,7 @@ get_syms_block_size(mrb_state *mrb, mrb_irep *irep)
size
+=
sizeof
(
uint16_t
);
/* snl(n) */
if
(
irep
->
syms
[
sym_no
]
!=
0
)
{
mrb_sym2name_len
(
mrb
,
irep
->
syms
[
sym_no
],
&
len
);
size
+=
len
;
/* sn(n)
*/
size
+=
len
+
1
;
/* sn(n) + null char
*/
}
}
...
...
@@ -194,6 +194,7 @@ write_syms_block(mrb_state *mrb, mrb_irep *irep, uint8_t *buf)
cur
+=
uint16_to_bin
((
uint16_t
)
len
,
cur
);
/* length of symbol name */
memcpy
(
cur
,
name
,
len
);
/* symbol name */
cur
+=
(
uint16_t
)
len
;
*
cur
++
=
'\0'
;
}
else
{
cur
+=
uint16_to_bin
(
MRB_DUMP_NULL_SYM_LEN
,
cur
);
/* length of symbol name */
...
...
src/load.c
View file @
99af3183
...
...
@@ -131,7 +131,7 @@ read_rite_irep_record(mrb_state *mrb, const uint8_t *bin, uint32_t *len)
}
irep
->
syms
[
i
]
=
mrb_intern2
(
mrb
,
(
char
*
)
src
,
snl
);
src
+=
snl
;
src
+=
snl
+
1
;
mrb_gc_arena_restore
(
mrb
,
ai
);
}
...
...
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