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
a3d240c2
Unverified
Commit
a3d240c2
authored
Dec 15, 2021
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Dec 15, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5599 from dearblue/loss-digits
Avoid losing the upper digits for mruby binary
parents
f5e10c5a
fa33a5bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
src/dump.c
src/dump.c
+2
-2
src/load.c
src/load.c
+3
-3
No files found.
src/dump.c
View file @
a3d240c2
...
...
@@ -51,7 +51,7 @@ get_iseq_block_size(mrb_state *mrb, const mrb_irep *irep)
size_t
size
=
0
;
size
+=
sizeof
(
uint16_t
);
/* clen */
size
+=
sizeof
(
uint
16
_t
);
/* ilen */
size
+=
sizeof
(
uint
32
_t
);
/* ilen */
size
+=
irep
->
ilen
*
sizeof
(
mrb_code
);
/* iseq(n) */
size
+=
irep
->
clen
*
sizeof
(
struct
mrb_irep_catch_handler
);
...
...
@@ -66,7 +66,7 @@ write_iseq_block(mrb_state *mrb, const mrb_irep *irep, uint8_t *buf, uint8_t fla
irep
->
clen
*
sizeof
(
struct
mrb_irep_catch_handler
);
cur
+=
uint16_to_bin
(
irep
->
clen
,
cur
);
/* number of catch handlers */
cur
+=
uint
16
_to_bin
(
irep
->
ilen
,
cur
);
/* number of opcode */
cur
+=
uint
32
_to_bin
(
irep
->
ilen
,
cur
);
/* number of opcode */
memcpy
(
cur
,
irep
->
iseq
,
seqlen
);
cur
+=
seqlen
;
...
...
src/load.c
View file @
a3d240c2
...
...
@@ -85,15 +85,15 @@ read_irep_record_1(mrb_state *mrb, const uint8_t *bin, size_t *len, uint8_t flag
src
+=
sizeof
(
uint16_t
);
/* number of child irep */
irep
->
rlen
=
(
uint8_t
)
bin_to_uint16
(
src
);
irep
->
rlen
=
bin_to_uint16
(
src
);
src
+=
sizeof
(
uint16_t
);
/* Binary Data Section */
/* ISEQ BLOCK (and CATCH HANDLER TABLE BLOCK) */
irep
->
clen
=
bin_to_uint16
(
src
);
/* number of catch handler */
src
+=
sizeof
(
uint16_t
);
irep
->
ilen
=
bin_to_uint
16
(
src
);
src
+=
sizeof
(
uint
16
_t
);
irep
->
ilen
=
bin_to_uint
32
(
src
);
src
+=
sizeof
(
uint
32
_t
);
if
(
irep
->
ilen
>
0
)
{
size_t
data_len
=
sizeof
(
mrb_code
)
*
irep
->
ilen
+
...
...
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