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
05e75445
Unverified
Commit
05e75445
authored
May 19, 2019
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
May 19, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4455 from dearblue/remove-LINE-section
Remove "LINE" section reader
parents
e60891e4
67fc3428
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
72 deletions
+0
-72
include/mruby/dump.h
include/mruby/dump.h
+0
-5
src/load.c
src/load.c
+0
-67
No files found.
include/mruby/dump.h
View file @
05e75445
...
...
@@ -60,7 +60,6 @@ MRB_API mrb_irep *mrb_read_irep(mrb_state*, const uint8_t*);
#define RITE_BINARY_EOF "END\0"
#define RITE_SECTION_IREP_IDENT "IREP"
#define RITE_SECTION_LINENO_IDENT "LINE"
#define RITE_SECTION_DEBUG_IDENT "DBG\0"
#define RITE_SECTION_LV_IDENT "LVAR"
...
...
@@ -92,10 +91,6 @@ struct rite_section_irep_header {
uint8_t
rite_version
[
4
];
/* Rite Instruction Specification Version */
};
struct
rite_section_lineno_header
{
RITE_SECTION_HEADER
;
};
struct
rite_section_debug_header
{
RITE_SECTION_HEADER
;
};
...
...
src/load.c
View file @
05e75445
...
...
@@ -233,66 +233,6 @@ read_section_irep(mrb_state *mrb, const uint8_t *bin, uint8_t flags)
return
read_irep_record
(
mrb
,
bin
,
&
len
,
flags
);
}
/* ignore lineno record */
static
int
read_lineno_record_1
(
mrb_state
*
mrb
,
const
uint8_t
*
bin
,
mrb_irep
*
irep
,
size_t
*
len
)
{
size_t
i
,
fname_len
,
niseq
;
*
len
=
0
;
bin
+=
sizeof
(
uint32_t
);
/* record size */
*
len
+=
sizeof
(
uint32_t
);
fname_len
=
bin_to_uint16
(
bin
);
bin
+=
sizeof
(
uint16_t
);
*
len
+=
sizeof
(
uint16_t
);
bin
+=
fname_len
;
*
len
+=
fname_len
;
niseq
=
(
size_t
)
bin_to_uint32
(
bin
);
bin
+=
sizeof
(
uint32_t
);
/* niseq */
*
len
+=
sizeof
(
uint32_t
);
if
(
SIZE_ERROR_MUL
(
niseq
,
sizeof
(
uint16_t
)))
{
return
MRB_DUMP_GENERAL_FAILURE
;
}
for
(
i
=
0
;
i
<
niseq
;
i
++
)
{
bin
+=
sizeof
(
uint16_t
);
/* niseq */
*
len
+=
sizeof
(
uint16_t
);
}
return
MRB_DUMP_OK
;
}
static
int
read_lineno_record
(
mrb_state
*
mrb
,
const
uint8_t
*
bin
,
mrb_irep
*
irep
,
size_t
*
lenp
)
{
int
result
=
read_lineno_record_1
(
mrb
,
bin
,
irep
,
lenp
);
int
i
;
if
(
result
!=
MRB_DUMP_OK
)
return
result
;
for
(
i
=
0
;
i
<
irep
->
rlen
;
i
++
)
{
size_t
len
;
result
=
read_lineno_record
(
mrb
,
bin
,
irep
->
reps
[
i
],
&
len
);
if
(
result
!=
MRB_DUMP_OK
)
break
;
bin
+=
len
;
*
lenp
+=
len
;
}
return
result
;
}
static
int
read_section_lineno
(
mrb_state
*
mrb
,
const
uint8_t
*
bin
,
mrb_irep
*
irep
)
{
size_t
len
;
len
=
0
;
bin
+=
sizeof
(
struct
rite_section_lineno_header
);
/* Read Binary Data Section */
return
read_lineno_record
(
mrb
,
bin
,
irep
,
&
len
);
}
static
int
read_debug_record
(
mrb_state
*
mrb
,
const
uint8_t
*
start
,
mrb_irep
*
irep
,
size_t
*
record_len
,
const
mrb_sym
*
filenames
,
size_t
filenames_len
)
{
...
...
@@ -578,13 +518,6 @@ read_irep(mrb_state *mrb, const uint8_t *bin, uint8_t flags)
irep
=
read_section_irep
(
mrb
,
bin
,
flags
);
if
(
!
irep
)
return
NULL
;
}
else
if
(
memcmp
(
section_header
->
section_ident
,
RITE_SECTION_LINENO_IDENT
,
sizeof
(
section_header
->
section_ident
))
==
0
)
{
if
(
!
irep
)
return
NULL
;
/* corrupted data */
result
=
read_section_lineno
(
mrb
,
bin
,
irep
);
if
(
result
<
MRB_DUMP_OK
)
{
return
NULL
;
}
}
else
if
(
memcmp
(
section_header
->
section_ident
,
RITE_SECTION_DEBUG_IDENT
,
sizeof
(
section_header
->
section_ident
))
==
0
)
{
if
(
!
irep
)
return
NULL
;
/* corrupted data */
result
=
read_section_debug
(
mrb
,
bin
,
irep
,
flags
);
...
...
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