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
7e3e8d8e
Commit
7e3e8d8e
authored
6 years ago
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shrink file name table size to `uint16_t`; ref #4138
parent
faf51f82
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
include/mruby/compile.h
include/mruby/compile.h
+2
-2
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
+6
-2
No files found.
include/mruby/compile.h
View file @
7e3e8d8e
...
...
@@ -158,8 +158,8 @@ struct mrb_parser_state {
struct
mrb_parser_message
warn_buffer
[
10
];
mrb_sym
*
filename_table
;
size
_t
filename_table_length
;
in
t
current_filename_index
;
uint16
_t
filename_table_length
;
uint16_
t
current_filename_index
;
struct
mrb_jmpbuf
*
jmp
;
};
...
...
This diff is collapsed.
Click to expand it.
mrbgems/mruby-compiler/core/parse.y
View file @
7e3e8d8e
...
...
@@ -5900,7 +5900,11 @@ mrb_parser_set_filename(struct mrb_parser_state *p, const char *f)
}
}
p->current_filename_index = (int)p->filename_table_length++;
if (p->filename_table_length == UINT16_MAX) {
yyerror(p, "too many files to compile");
return;
}
p->current_filename_index = p->filename_table_length++;
new_table = (mrb_sym*)parser_palloc(p, sizeof(mrb_sym) * p->filename_table_length);
if (p->filename_table) {
...
...
@@ -5912,7 +5916,7 @@ mrb_parser_set_filename(struct mrb_parser_state *p, const char *f)
MRB_API char const*
mrb_parser_get_filename(struct mrb_parser_state* p, uint16_t idx) {
if (idx >= p->filename_table_length)
{ return NULL; }
if (idx >= p->filename_table_length)
return NULL;
else {
return mrb_sym2name_len(p->mrb, p->filename_table[idx], NULL);
}
...
...
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