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
79a7f181
Commit
79a7f181
authored
Apr 16, 2019
by
KOBAYASHI Shuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid potential zero size array declaration; fix #4382
parent
4e45e320
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
include/mruby/array.h
include/mruby/array.h
+1
-2
tasks/toolchains/clang.rake
tasks/toolchains/clang.rake
+2
-0
No files found.
include/mruby/array.h
View file @
79a7f181
...
...
@@ -33,7 +33,6 @@ struct RArray {
}
aux
;
mrb_value
*
ptr
;
}
heap
;
mrb_value
embed
[
MRB_ARY_EMBED_LEN_MAX
];
}
as
;
};
...
...
@@ -46,7 +45,7 @@ struct RArray {
#define ARY_UNSET_EMBED_FLAG(a) ((a)->flags &= ~(MRB_ARY_EMBED_MASK))
#define ARY_EMBED_LEN(a) ((mrb_int)(((a)->flags & MRB_ARY_EMBED_MASK) - 1))
#define ARY_SET_EMBED_LEN(a,len) ((a)->flags = ((a)->flags&~MRB_ARY_EMBED_MASK) | ((uint32_t)(len) + 1))
#define ARY_EMBED_PTR(a) (
&((a)->as.embed[0])
)
#define ARY_EMBED_PTR(a) (
(mrb_value*)&(a)->as
)
#define ARY_LEN(a) (ARY_EMBED_P(a)?ARY_EMBED_LEN(a):(a)->as.heap.len)
#define ARY_PTR(a) (ARY_EMBED_P(a)?ARY_EMBED_PTR(a):(a)->as.heap.ptr)
...
...
tasks/toolchains/clang.rake
View file @
79a7f181
...
...
@@ -3,7 +3,9 @@ MRuby::Toolchain.new(:clang) do |conf, _params|
[
conf
.
cc
,
conf
.
objc
,
conf
.
asm
].
each
do
|
cc
|
cc
.
command
=
ENV
[
'CC'
]
||
'clang'
cc
.
flags
<<
'-Wzero-length-array'
unless
ENV
[
'CFLAGS'
]
end
conf
.
cxx
.
command
=
ENV
[
'CXX'
]
||
'clang++'
conf
.
cxx
.
flags
<<
'-Wzero-length-array'
unless
ENV
[
'CXXFLAGS'
]
||
ENV
[
'CFLAGS'
]
conf
.
linker
.
command
=
ENV
[
'LD'
]
||
ENV
[
'CXX'
]
||
ENV
[
'CC'
]
||
'clang'
end
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