Age | Commit message (Collapse) | Author | Files | Lines |
|
Change-Id: I0c87ad2cf8f8768cf40c5b7abea0add087a5518a
|
|
The validator previously did not check if a struct within a union was
valid, causing a heap buffer overflow. Add a check to make sure that
the struct is valid in this case.
Change-Id: I87d41b12fdfc2a99406789531ba92b841c063c76
|
|
fixes #5288
|
|
* C++: Generate MiniReflectTypeTable for Structs as well as Tables
* Update generated code
* add test
|
|
|
|
Change-Id: I3ee68c5f250d6baa02060ab2ecbc0f0fe254a9d8
|
|
Change-Id: I487ded77d28490189dd5d38236cb04bffaf5f11a
|
|
* Detect leak with sanitizer
* Fix proto-enum leak issue
|
|
|
|
* Ensure we don't subtract with underflow getting enum names
* Yep - forgot to run this
|
|
* Create a function GenerateGenerateTextFromTable in order to create a json from any Table
Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
* Update the test to failed if loadfile or parser return false
Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
* Fix snake_case name typo + space before &/*
Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
* use auto
Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
* Use clang-format on the added code
Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
|
|
|
|
|
|
|
|
* Correct the usage in the flathash program
As it is possible to have -- before the occurrence of the first
input STRING.
* Exit with 1 in the flathash program when an error occurs
|
|
Original change by: https://github.com/alexames
Change-Id: Ib65bd02156d1c3637ed278a8334a2307caacaa44
|
|
generic code. (#5232)
|
|
implement better custom string type constructor alternative
for Unpack() and fix bug with vector of custom string types
in Pack().
Squashed commit of the following:
commit e9519c647ef949b22756ed660839dd3af854881c
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Tue Mar 5 18:24:49 2019 +0100
tests: regenerate code, reverts change to CreateVectorOfStrings().
commit 117e3b0679209f2aa55cbee18c4036e7da4bd4b3
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Tue Mar 5 18:15:05 2019 +0100
idl_gen_cpp.cpp: move clang-format on/off outside of declaration, so they are kept properly aligned automatically.
commit 4791923806965637d5b13f7003329bfbb2fdf18b
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Tue Mar 5 18:11:40 2019 +0100
idl_gen_cpp.cpp: full clang-format run with provided Google format file, enforce 80 lines width.
commit 2f0402f9ff43b1af0a29806932e08e6d64373345
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Tue Mar 5 18:09:32 2019 +0100
CppUsage: address requested changes.
idl_gen_cpp.cpp: fix formatting, keep CreateVectorOfStrings for normal string cases.
commit 371d4e0b7972a59e5cff418c44e4043c016ce56a
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Fri Mar 1 16:35:29 2019 +0100
Fix compile error with a vector of non-std::strings. CreateVectorOfStrings() expects a vector of std::string types, but that's not always the case.
commit 92b90d7f0fbcfc837a94aa06bedccec0f7b4bb62
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Fri Mar 1 16:15:36 2019 +0100
Document requirement for custom string types to implement empty() and be constructible from std::string.
Add new option --cpp-str-flex-ctor to construct custom string types not via std::string, but (char * + length).
commit 28cb2e92d5b7684b5df5184da3a3fad2d0cda733
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Fri Mar 1 14:31:17 2019 +0100
idl_gen_cpp.cpp: clang-format run, to better separate changes in content from formatting.
Change-Id: I4887ba2f2c632b9e7a8c938659b088cd95690870
|
|
* Don't use inner attributes for `allow`
Messes with being able to easily include elsewhere
* Regenerate tests
* No-op to retrigger CI
* Add the rest of the `allow` attributes
|
|
|
|
This for some reason never had a test case, and was broken.
Change-Id: If832f5eb8b6c5ba8a75257464892634b38719c55
|
|
|
|
Fixes #5206
|
|
* Clean-up nested_parser on all paths (#5179)
* Added test for parsing json with invalid nested flatbuffer
* Removed utf-8 BOM from test.cpp
|
|
(#5222)
|
|
* Fix lifetime in union _as_ accessors
In the accessors for union field, the return value is implicitly taking the lifetime of &self.
This is irrelevant and prevents usages of the returned value, because it is needlessly bound to the parent field lifetime.
This patch makes the return value inherit the lifetime of the data, like other methods do.
|
|
vtable and vtable size depends only on `Table#bb_pos` but calculated in
`Table#_offset` method on each field lookup.
Doing this with every call of `Table#__offset` is redundant.
These values can be read once with change of `Table#bb_pos` and reused
for any field lookup.
|
|
Also fixed warnings this generated.
Change-Id: If3607907b2dd609f854b7b81225d9cf66af75a60
|
|
* Fixed vector of unions crash in java
* Regenerated test code
* Fixed windows tests
|
|
* Add utility for checking the encoding of source files
- accept source files with ASCII or UTF-8 without BOM
- accept only CRLF line ending
* Fix non-ascii symbol in idl_parcer.cpp
* Remove BOM from test.cpp
|
|
the TypeScript code generation. I also added code so that the create methods have documentation in both JavaScript and TypeScript. (#5168)
|
|
|
|
* Add flag to make short names in JS/TS.
* Synced all missing docs in Compiler.md <-> flatc.cpp.
* Review changes.
|
|
* Implement native_shared attribute for C++.
Fixes #5141. See also #5145.
* Refine comment in idl.h
* Also refine docs
* Revert "Also refine docs"
This reverts commit 09dab7b45c56c2d17eac493203adc8caaa0df2cc.
* Also refine docs again.
* grumble
|
|
with non-sequential enums as well as those beginning at something other than zero. (#5151)
Also including the resulting changes in php files.
|
|
- GCC: fixed broken `fallthrough` (checked with 7.3 and 8.2)
- Clang: added `fallthrough` support
- Clang: added `-Wimplicit-fallthrough` checking
|
|
- enable FLATBUFFERS_ATTRIBUTE if C++17 or higher
|
|
* [Rust] Added global namespace imports
* Documented the need for global imports
* Added white_space params to GenNamespaceImports
* Removed a \n from GenNamespaceImports
|
|
* Fix high certainty warnings from PVS-studio
- Introduced FLATBUFFERS_ATTRIBUTE macro to use [[attribute]] if modern C++ compiler used
* Update the note about __cplusplus usage in the MSVC
|
|
* Add default NaN/Inf to C#, Java, Python
* Python NaN/Inf test added
* Remove MSVC2010/13 dependent code
|
|
|
|
* Add `NaN` and `Inf` defaults to the C++ generated code.
* Refactoring: add FloatConstantGenerator
* Refactoring-2:
- remove isnan checking for all float/double values
- add most probable implementation of virtual methods of FloatConstantGenerator
* Add conditional (FLATBUFFERS_NAN_DEFAULTS) isnan checking
|
|
Track and emit required FlatBuffers namespace imports in generated Go code.
Update Go code generator by moving most functionality into the generator class, to facilitate namespace tracking. (Note that the git diff in this combined commit may appear large due to this refactoring, but very little code was actually changed.)
Update Go code generator by tracking namespace imports when generating FlatBuffers code.
Update Go code generator by emitting package imports to correctly reference code in other FlatBuffers namespaces.
Create Go test that checks the usage of InParentNamespace objects (as defined in the example schema).
Create Docker test that checks the Go language port.
Fixes #4883
Fixes #3927
Individual commits:
* remove "static" from soon-to-be method functions
* move almost all functions into class as methods
* set current namespace and emit package names if needed
* track imported namespaces
* parent namespaces work
* docker test for go ^1.11
* update base image name for go docker test
* remove cerr debugging
* formatting fixes
* re-run generate_code.sh
* explicitly test namespace imports and usage
|
|
By avoiding redundant alignment+alloc checks (startVector does prep) and virtual calls
(by making the class final) in inner loops.
|
|
* Enable flatbuffer to initialize Parser from bfbs (#4283)
Now its possible to generate json data from bfbs data type and flatbuffers data
and visa versa.
* add deserialize functionality in parser from bfbs
* add small usage sample
* Fix build break
* Merge branch 'pr/1' into fix-issue4283
* Fix buildbreak
* Build monster_test.bfbs with --bfbs-builtins
Attribute flexbuffer has be included in bfbs. Only with this attribute test
will run. By initialization a parser by a bfbs the attribute has to be known
for this filed. monsterdata_test.golden has a flexbuffer field so parse would
fail.
* Fix generate_code.sh
* Revert automatic indent changes by IDE
* Auto detect size prefixed binary schema files
* Use identifier (bfbs) to detect schema files
|
|
flatc version (#5086)
* disable reproducible build warning due to date/time macros
* wrapped GCC pragmas in #ifdef _GNUC_
* removed __DATE__ and __TIME__ macros from flatc.cpp
|
|
|
|
The use case is so we can batch compile a bunch of schemas, some which can depend on each other, without caring about their order.
|
|
Multiple calls of e.g. CreateString inside a call to a CreateTable
could cause those strings to end up in different locations in the
wire format, since order or argument evaluation is undefined.
This is allowed by the FlatBuffer format, but it is not helpful,
especially when debugging the contents of binaries, or comparing
against a "golden" binary for tests etc.
Now making sure that all the CreateTableDirect calls first serialize
sub strings/vectors before calling CreateTable.
Also made similar changes to the serialization of "binary schemas".
Change-Id: I5747c4038b37a0d400aca2bc592bec751cf5c172
|
|
* Make the Parser independent from the global C-locale
* Set a specific test locale using the environment variable FLATBUFFERS_TEST_LOCALE
* Remove redundant static qualifiers
|