summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2019-04-24Bumped version to 1.11.0v1.11.0Wouter van Oortmerssen1-1/+1
Change-Id: I0c87ad2cf8f8768cf40c5b7abea0add087a5518a
2019-04-19Fix heap-buffer-overflow if there is a struct within a unionWouter van Oortmerssen1-1/+2
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
2019-04-15fix check for Enum defaults (#5292)Nils Berg1-1/+1
fixes #5288
2019-04-15Struct typetable (#5291)Nils Berg1-0/+9
* C++: Generate MiniReflectTypeTable for Structs as well as Tables * Update generated code * add test
2019-04-15Add logging of warnings from the flatc compiler (#5289)Vladimir Glavnyy2-2/+6
2019-04-11Fixed VS2010 build.Wouter van Oortmerssen1-1/+2
Change-Id: I3ee68c5f250d6baa02060ab2ecbc0f0fe254a9d8
2019-04-11Allow Set() methods to handle reference typesWouter van Oortmerssen1-4/+3
Change-Id: I487ded77d28490189dd5d38236cb04bffaf5f11a
2019-04-11Fix the proto-enum leaking issue (#5286)Vladimir Glavnyy1-2/+10
* Detect leak with sanitizer * Fix proto-enum leak issue
2019-04-08Part of #5265, neutral changes (#5281)Vladimir Glavnyy13-113/+102
2019-04-05Ensure we don't subtract with underflow getting enum names (#5246)Matt Mastracci1-3/+3
* Ensure we don't subtract with underflow getting enum names * Yep - forgot to run this
2019-04-05Add method GenerateTextFromTable issue #5249 (#5266)Anthony Liot1-0/+17
* 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>
2019-04-05Fix for build break in c# vector of unions (#5271)Kamil Rojewski1-1/+1
2019-03-25Fix a warning on compiling with clang (#5258)Nikolay Kuznetsov1-2/+2
2019-03-25Add inequality operator (inspired from #263) (#5257)LouisP1-0/+18
2019-03-21[C++] Changes in the flathash program (#5255)Henry Lee1-3/+3
* 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
2019-03-11Made JS enum declarations compatible with google closureWouter van Oortmerssen1-17/+18
Original change by: https://github.com/alexames Change-Id: Ib65bd02156d1c3637ed278a8334a2307caacaa44
2019-03-11Narrows template ascii routines to prevent a possible signed overflow in ↵Vladimir Glavnyy1-2/+2
generic code. (#5232)
2019-03-11[C++] Object API: document custom string type requirements,Wouter van Oortmerssen2-169/+230
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
2019-03-09[Rust] Don't use inner attributes for `allow` (#5212)bspeice1-2/+1
* 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
2019-03-08Small usability tweaks to the rust codegen. (#5213)Mathias Svensson1-3/+3
2019-03-07Fixed vector of union JSON parsing.Wouter van Oortmerssen1-35/+66
This for some reason never had a test case, and was broken. Change-Id: If832f5eb8b6c5ba8a75257464892634b38719c55
2019-03-06[Rust] Fixed codegen documentation for Tables (#5227)jean-airoldie1-2/+3
2019-03-05[Go] Add mutation functions for vector elements (#5221)David Reiss1-0/+25
Fixes #5206
2019-03-04Clean-up nested_parser on all paths (#5179) (#5184)ll-antn1-7/+9
* Clean-up nested_parser on all paths (#5179) * Added test for parsing json with invalid nested flatbuffer * Removed utf-8 BOM from test.cpp
2019-03-04[Fix #5112] flatc generates constructors with memset for non-trivial types ↵Laurent Stacul1-1/+1
(#5222)
2019-02-26Rust: Fix lifetime in union _as_ accessors (#5140)naure1-2/+2
* 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.
2019-02-25Java: Calculation of vtable and vtable size moved to the __init method. (#5210)Kulikov Alexey1-1/+9
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.
2019-02-25Added -Wextra-semi to Clang build.Wouter van Oortmerssen5-16/+16
Also fixed warnings this generated. Change-Id: If3607907b2dd609f854b7b81225d9cf66af75a60
2019-02-21Fixed vector of unions crash in java (#5190)Kamil Rojewski1-1/+3
* Fixed vector of unions crash in java * Regenerated test code * Fixed windows tests
2019-02-19Utility for checking the encoding and line ending of source files (#5188)Vladimir Glavnyy1-1/+1
* 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
2019-02-15Changed the JavaScript generation to emit createX helper functions just like ↵Christopher Cifra1-47/+89
the TypeScript code generation. I also added code so that the create methods have documentation in both JavaScript and TypeScript. (#5168)
2019-02-14Generting imports for external enums in TS (#5175)Kamil Rojewski1-2/+6
2019-02-11Add flag to make short names in JS/TS. (#5152)Gabriel Nützi2-28/+40
* Add flag to make short names in JS/TS. * Synced all missing docs in Compiler.md <-> flatc.cpp. * Review changes.
2019-02-11Implement (shared) attribute for C++ (#5157)iceboy2-3/+19
* 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
2019-02-04Changing array to be an associative array so that the Name function can work ↵Travis Staley1-1/+1
with non-sequential enums as well as those beginning at something other than zero. (#5151) Also including the resulting changes in php files.
2019-01-28Repair `fallthrough` was broken by d4493165 (#5115) (#5139)Vladimir Glavnyy4-8/+7
- GCC: fixed broken `fallthrough` (checked with 7.3 and 8.2) - Clang: added `fallthrough` support - Clang: added `-Wimplicit-fallthrough` checking
2019-01-24Replace deprecated Vector::Length() with Vector::size() (#5131)Vladimir Glavnyy3-6/+6
- enable FLATBUFFERS_ATTRIBUTE if C++17 or higher
2019-01-24[Rust] Added global namespace imports (#5121)jean-airoldie1-8/+19
* [Rust] Added global namespace imports * Documented the need for global imports * Added white_space params to GenNamespaceImports * Removed a \n from GenNamespaceImports
2019-01-17Fix high certainty warnings from PVS-studio (#5115)Vladimir Glavnyy1-4/+6
* 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
2019-01-14Add default NaN/Inf to C#, Java, Python (#5107)Vladimir Glavnyy4-58/+133
* Add default NaN/Inf to C#, Java, Python * Python NaN/Inf test added * Remove MSVC2010/13 dependent code
2019-01-07Move all platform dependent headers and code to util.cpp module (#5106)Vladimir Glavnyy1-5/+116
2019-01-07Add `NaN` and `Inf` defaults to the C++ generated code. (#5102)Vladimir Glavnyy2-3/+75
* 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
2018-12-27[Go] Namespaced imports fix (#5097)Robert1-640/+685
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
2018-12-20Performance improvement to generated+supporting PHP (#5080)Peter Dillinger1-2/+2
By avoiding redundant alignment+alloc checks (startVector does prep) and virtual calls (by making the class final) in inner loops.
2018-12-13Enable flatbuffer to initialize Parser from bfbs (#4283) (#5077)tira-misu2-14/+349
* 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
2018-12-10Get rid of reproducible build warning by removing build date & time from ↵Rob Agar1-1/+1
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
2018-12-06Renamed JS generator to explicitly state it generates TS too (#5043)Kamil Rojewski2-16/+16
2018-11-16Make Parser skip files it's seen already. (#5048)Russell Chou1-4/+11
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.
2018-11-16Make string/vector field serialization order not depend on optimizer.Wouter van Oortmerssen2-78/+82
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
2018-11-16Make the Parser independent from the global C-locale (#5028)Vladimir Glavnyy2-2/+51
* 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