summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-01-07fix Dart Builder._writeString() - always write trailing zero byte (#6390)Ivan Dlugos1-0/+1
2021-01-07fix Dart Builder.reset() - clear vTables (#6386)Ivan Dlugos1-0/+1
2021-01-07[C++, JSON] Fix nullptr access when reading a key with a default value. (#6375)Vladimir Glavnyy28-574/+1238
This commit fixes handling of default and NULL `key` fields in `Parser::ParseVector` (#5928). The JSON generator updated. It outputs `key` fields even if the `--force-defaults` option is inactive. Additional test cases for `key` added.
2021-01-05Fix generated EndVector. (#6385)Richard A Hofer2-3/+3
2021-01-05Implements type promotion for Java enum (#6382)Stefan de Konink2-4/+4
* Implements type promotion for Java enum as suggested in #3890, #5111, #6369 * After generate_code.sh
2021-01-05Delete label_notify.ymlDerek Bailey1-17/+0
Removing this workflow as it isn't used.
2021-01-04Disabled PHP CI (#6381)Wouter van Oortmerssen1-13/+13
It errors with "Fatal error: Uncaught exception 'InvalidArgumentException' with message 'bad number for type byte.. in /home/runner/work/flatbuffers/flatbuffers/php/ByteBuffer.php:490" which I can't reproduce locally, and trying to fix it on CI runs into PHP's insane handling of numbers vs strings.
2021-01-04fixed warnings (#6355)Kamil Rojewski8-106/+113
* semver-compatible deprecations * removed unneeded lifetimes (+ clippy warnings) * silenced too many args warning
2021-01-04Fix multiple fbs code generation failure (#6365)Bruno ZIKI Kongawi1-2/+10
2021-01-04[idl_parser] Improve stack overflow protection (#6364)Vladimir Glavnyy6-58/+84
* [idl_parser] Improve stack overflow protection Add stack overflow protection for Flexbuffer and nested Flatbuffer parsers. Replaces the `Recurse()` method by the new ParseDepthGuard RAII class. * Remove move operator from Parser. It was wrong decision to add move ctor and assignment into Parser class. These operators will make it extremely difficult to add constant or reference fields in the future. * Remove ';' from definition of FLATBUFFERS_DELETE_FUNC * Format code * Make this PR compatible with MSVC2010 (it doesn't support inherited ctor)
2021-01-04[idl_parser] Check the range of explicitly set field's id value (#6363)Vladimir Glavnyy2-9/+53
* [idl_parser] Check the range of explicitly set field's id value The explicitly set `id` attribute should be a non-negative value of the `voffset_t` type. * Format FieldIdentifierTest()
2021-01-04Generate code to encode and decode nested flatbuffers in Python. (#6354)Richard A Hofer3-0/+127
* Generate code to encode and decode nested flatbuffers in Python. * Delete accidental trailing whitespace. * Fully delete trailing whitespace.
2021-01-04[Rust] Shared String (#6367)mustiikhalil3-0/+92
* Adds shared strings and tests for shared strings * Adds resets on string_map * Moved shared strings to use vector instead of hashmap * Addresses all the issues * Resolves some comments
2021-01-02Updates license date to 2021 (#6378)mustiikhalil25-25/+25
2020-12-30include_prefix support for rust (#6330)Kamil Rojewski1-2/+10
* include_prefix support for rust * include_prefix support for java * formatting fixes * Revert "include_prefix support for java" * style fix
2020-12-17[Swift] Rebuild the way swift handles structs from scratch (#6326)mustiikhalil21-718/+1049
* Rebuild the way swift handles structs from scratch * Updates docs, and sample binary * Replaces InMemory to Mutable * Migrates docs from inmemory * use inline for some functions * Renamed Mutable objects * Updates documentation
2020-12-17Fix typos in usage/comments; Make rust generator respect to --filenam… (#6342)mqy3-6/+7
* Fix typos in usage/comments; Make rust generator respect to --filename-suffix * run clang format
2020-12-17Renaming infinity variables in test.cpp (#6340)Kjetil Østerås1-26/+26
The infinityf symbol is causing a conflict when building for cygwin. In the cygwin math.h header there is also a symbol called infinityf. So this patch is needed to be able to build the flatbuffer tests in a cygwin environment.
2020-12-14Add vectorNumElements attribute to Builder for simpler vector creation. (#6328)Richard A Hofer7-64/+61
* Add vectorNumElements attribute to Builder for simpler vector creation. This adds a default to EndVector which should simplify its use. * Update tutorial to reflect new default arg in Python EndVector. * Remove optional argument to Python EndVector. * Add generated files. * Unset Builder.vectorNumElems when not in use.
2020-12-11[CI] Adds formatter to CI (#6272)mustiikhalil4-0/+154
* Adds formatters CI Adds Error message & setup formatting like cpp Adds Swift Adds typescript Adds python tests yarn Adds format.md * Removes unneeded scripts + moves install script to install phase * Adds format.md content * Adds cpp to the formatter.md and fixes ci * Adds cpp to formatter ci
2020-12-11Fix Max CI build path (#6333)Wouter van Oortmerssen1-4/+5
apparently the default xcodebuild path of ./build clashes with the BUILD file present (case insensitive file system?)
2020-12-10Generate nullable properties in C# object-based API for optional scalars. ↵Stefan F4-2/+176
(without -gen-mutable) (#6273) * Added missing EndTable() call to VerifyObject() VerifyObject called VerifyTableStart() but not EndTable(). This made Verifier::VerifyComplexity() increase depth_ with each table, not with the depth of tables. https://groups.google.com/forum/#!topic/flatbuffers/OpxtW5UFAdg * Added Check to VerifyAlignment https://stackoverflow.com/questions/59376308/flatbuffers-verifier-returns-false-without-any-assertion-flatbuffers-debug-veri * Add GetStringView (Convenience function to get string_view from a String returning an empty string_view on null pointer) like GetString, GetCstring * flatc should warn, when an attribute is attached more than once. flatc.exe -b duplicate.fbs warning: duplicate.fbs(5, 36): warning: attribute already found: priority duplicate.fbs: namespace MyGame; attribute "priority"; table Monster (priority:1, priority:2) { } root_type Monster; * flatc should support --binary --schema with optional scalar fields. This fixes 'error: Optional scalars are not yet supported in at least one the of the specified programming languages.' when calling flatc.exe --binary --schema with a schema containing optional scalars. * Generate nullable properties in C# object-based API for optional scalars. tests\generate_code.bat extended to test this. Ran tests\generate_code.bat Ran tests\Flatbuffers.Test\NetTest.bat * %TEST_BASE_FLAGS% replaced with --gen-object-api in generate_code.bat, because only this is part of this PR. Added this same flag to generate_code.sh * generate_code.bat and generate_code.sh changed to only test c# with object based api.
2020-12-10[Python] Commit some orphan python genfile diffs. (#6325)David P. Sicilia13-13/+13
2020-12-10Fixed missing ending quotes in labeller (#6327)Derek Bailey1-2/+2
2020-12-10Add flatc option to inhibit all warnings #6005 (#6301)tira-misu4-1/+14
* Fix C/C++ Create<Type>Direct with sorted vectors If a struct has a key the vector has to be sorted. To sort the vector you can't use "const". * Changes due to code review * Improve code readability * Add generate of JSON schema to string to lib * option indent_step is supported * Remove unused variables * Fix break in test * Fix style to be consistent with rest of the code * Add option --no-warnings to inhibit all warnings * Fix order of member initialization * Add documentation for --no-warnings
2020-12-10[fuzzer] Rename fuzzing dictionaries for `oss-fuzz` (#6318)Vladimir Glavnyy7-4/+26
This commit makes the names of fuzzing dictionaries the same as the target binary names. Also it explicitly limits size of test inputs to prevent failures in `regex` and fuzzing time-outs.
2020-12-09bumprust (#6322)Casper1-1/+1
Co-authored-by: Casper Neo <cneo@google.com>
2020-12-07Set default initialSize for Builder to 0 (#6310)Richard A Hofer1-1/+1
* Set default initialSize for Builder to 0 * Change default size of builder to 1024. This matches what the C++ and Java versions do.
2020-12-07Rust Flatbuffers Verifier (#6269)Casper21-301/+1857
* Updated comments and fixed a fundemental type error. * bump rust flatbuffers semver * Initial commit with verifier, need to clean up * Verifier tested. Needs clean up and refactoring. * Display for InvalidFlatbuffer and better errors for strings * SimpleToVerify, some refactoring * Combined VerifierType TableAccessorFuncBody into FollowType * scrub todos * Update Rust get_root functions. There are 6 variants, with verifier options, default verifier options and no verification "fast". * Rename root fns * inline * Update to use thiserror * fix for bad compiler * improve error formatting * Replace multiply with saturating_multiply * saturating adds too * Add docs disclaiming experimental verification system Co-authored-by: Casper Neo <cneo@google.com>
2020-12-07Version message should be a "STATUS" to avoid going to stderr. (#6316)David P. Sicilia1-1/+1
2020-12-07Replace std::string and const char* CreateSharedString with string_view (#6315)Austin Schuh1-0/+11
It is useful to be able to call CreateSharedString with a string_view. A string_view can be implicitly converted from a std::string or a const char*. This means if string_view is available, we can use it instead of both other functions and get all 3.
2020-12-07[fuzzer] Fix mistakes in the `parser` and `scalar` fuzzers. (#6314)Vladimir Glavnyy2-22/+10
The flatbuffers::Parser::Parse() isn't an idempotent method for schema parsing. This commit removes a wrong for-loop that tried to check the same schema twice.
2020-12-07Add default to offset param of Python generated GetRootAs (#6312)Richard A Hofer1-1/+1
2020-12-07[fuzzer] Fix loading of schema in monster_fuzzer (#6308)Vladimir Glavnyy2-33/+21
This is fix for (https://oss-fuzz.com/testcase-detail/6251772204810240)
2020-12-07[C++] Switch `flatc` to `--cpp-std c++11` C++ code generator (#6306)Vladimir Glavnyy13-287/+168
Prior to this commit the default C++ code generator was `c++0x`. A code generated with `c++0x` code-gen might have a vulnerability (undefined behavior) connected evolution of enums in a schema. This UB could break the backward compatibility if previously generated code casts an unknown enumerator to enum type that knows nothing about future enumerators added to the schema. The main differences between `c++0x` and `c++11`: - generated enums use explicitly declared underlying type; - generated object-API tables don't declare default ctor() explicitly, instead of it default data member initializers are generated. Please use `flatc --cpp-std c++0x` option for backward compatibility with old compilers.
2020-12-07[idl_parser] Unify parsing of NaN values read from .fbs and .json files (#6296)Vladimir Glavnyy7-8/+55
This commit unifies parsing of NaN values read from .fbs and .json files by converting them to unsigned NaN.
2020-12-03Moved various language tests from AppVeyor to GitHub Actions (#6300)Wouter van Oortmerssen2-40/+111
2020-11-24Documentation updates for Optional Scalars (#6014) (#6270)Casper3-78/+100
* Documentation updates for Optional Scalars * Updated Support * Reword stuff * s/NULL/null Co-authored-by: Casper Neo <cneo@google.com>
2020-11-23[C++] Add ParseJson(), Parser(Parser&&), update fuzzers (#6284)Vladimir Glavnyy16-41/+410
- add a new method ParseJson to minimize failures during fuzzing - add default (conditional) move-constructor for Parser - add a new monster_fuzzer - switch fuzzers to C++17 and `test/cpp17` generated code
2020-11-23Fixed FlexBufferBuilder asserting on duplicate keysWouter van Oortmerssen2-3/+15
2020-11-19Added a few more paths for auto labeler (#6281)Derek Bailey1-0/+9
2020-11-19Add --require-explicit-ids to require explicit ids (#6277)Austin Schuh4-4/+20
* Add --require-explicit-ids to require explicit ids We just got bit by a well intentioned developer forgetting that field order by default is the field index. 3 people missed it in review. I'm looking at ways to make it harder to mess up. We are requesting that developers explicitly id all fields in tables. Automatic (opt in for others) enforcement of this will help the effort succeed. This patch adds a command line flag which lets the user require ids on all fields in tables. * Added docs to Compiler.md as well
2020-11-19idl_gen_json_schema.cpp: Changed generation of array element types (#6253)schoetbi3-30/+39
* idl_gen_json_schema.cpp: Changed generation of array element types #6175 * idl_gen_json_schema.cpp: Simplified indent generation as suggested by @vglavnyy #6175
2020-11-19fix typo (#6280)Kelvin Hu1-1/+1
2020-11-19Updated Ms build Action to fix build issue (#6279)Derek Bailey1-1/+1
2020-11-16Add type annotation to unspecified array (#6264)James Kuszmaul1-2/+2
The lack of any type on the `ret` variable was causing our typescript compiler to complain.
2020-11-16[Swift] Adds a format file and reformats the swift project (#6250)mustiikhalil39-4480/+5079
* Formats files & adds licence * Revert arrays * Keeps array indentation as is * Adds licence to code formatter * Updates code generators
2020-11-15Adds a fix for enum generation (#6263)mustiikhalil1-1/+0
2020-11-13Experimental fix for failing oss-fuzz coverage build (#6259)AdamKorcz1-1/+1
2020-11-13BREAKING: Rust flexbuffers serde human readable set to false (#6257)Casper3-1/+19
Co-authored-by: Casper Neo <cneo@google.com>