forked from Diggsey/ijson
-
Notifications
You must be signed in to change notification settings - Fork 0
MOD-14010 support Homogenues array floating point forcing(deserializa… #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AvivDavid23
merged 33 commits into
master
from
MOD-13577-datatypes-json-homogeneous-fp-arrays-declare-fp-type
Mar 3, 2026
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
8e137e1
MOD-13577 support Homogenues array floating point forcing(deserializa…
AvivDavid23 bfd678b
add fallback option
AvivDavid23 2079a68
export FPHAConfig
AvivDavid23 cec89cf
docs
AvivDavid23 bc60e68
fmt
AvivDavid23 931d520
comments
AvivDavid23 3ba050f
lower fuzz time
AvivDavid23 8cd9ddf
bring back old code
AvivDavid23 3cfee7d
change to lossy push
AvivDavid23 f166310
Binary encoder/decoder
AvivDavid23 fa80dbe
remove fallback from FPHAConfig
AvivDavid23 6780eac
more fuzz tests
AvivDavid23 86e63be
tag to enum
AvivDavid23 746ac87
update fuzz parameters in ci
AvivDavid23 f3d275d
fmt
AvivDavid23 954fa38
remove print in fuzz
AvivDavid23 8222832
wrap with zstd compression
AvivDavid23 4bfdfec
misc
AvivDavid23 b6e1ac7
move to cbor based implementation
AvivDavid23 2a547e2
.
AvivDavid23 b40b8d8
fmt
AvivDavid23 043b76c
CR
AvivDavid23 8fdfd04
move to fork of ciborium
AvivDavid23 2351ace
fix CR
AvivDavid23 a62bd2d
fmt
AvivDavid23 00cefdc
misc: JsonValue in fuzz tests to use serde
AvivDavid23 be16c77
fmt
AvivDavid23 432f62e
revert to manual string in fuzz, fix push_with_fp case
AvivDavid23 0d11fe8
cr
AvivDavid23 ebcad76
remove dead code
AvivDavid23 c1ff908
.
AvivDavid23 95369f0
CR
AvivDavid23 9675e63
move to arbitrary-json crate in fuzz tests
AvivDavid23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #![no_main] | ||
|
|
||
| use ijson::cbor::decode; | ||
| use libfuzzer_sys::fuzz_target; | ||
|
|
||
| fuzz_target!(|data: &[u8]| { | ||
| let _ = decode(data); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #![no_main] | ||
|
|
||
| use arbitrary_json::ArbitraryValue; | ||
| use ijson::{cbor, IValue}; | ||
| use libfuzzer_sys::fuzz_target; | ||
| use serde::Deserialize; | ||
|
|
||
| fuzz_target!(|value: ArbitraryValue| { | ||
| let json_string = value.to_string(); | ||
| let mut deserializer = serde_json::Deserializer::from_str(&json_string); | ||
| let Ok(original) = IValue::deserialize(&mut deserializer) else { | ||
| return; | ||
| }; | ||
|
|
||
| let encoded = cbor::encode(&original); | ||
| let decoded = cbor::decode(&encoded).expect("encode->decode round-trip must not fail"); | ||
|
|
||
| assert_eq!( | ||
| original, decoded, | ||
| "round-trip mismatch for input: {json_string}" | ||
| ); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,54 +1,12 @@ | ||
| #![no_main] | ||
|
|
||
| use arbitrary::Arbitrary; | ||
| use arbitrary_json::ArbitraryValue; | ||
| use ijson::IValue; | ||
| use libfuzzer_sys::fuzz_target; | ||
| use serde::Deserialize; | ||
| use std::collections::HashMap; | ||
|
|
||
| #[derive(Arbitrary, Debug)] | ||
| enum JsonValue { | ||
| Null, | ||
| Bool(bool), | ||
| Number(f64), | ||
| String(String), | ||
| Array(Vec<JsonValue>), | ||
| Object(HashMap<String, JsonValue>), | ||
| } | ||
|
|
||
| impl JsonValue { | ||
| fn to_json_string(&self) -> String { | ||
| match self { | ||
| JsonValue::Null => "null".to_string(), | ||
| JsonValue::Bool(b) => b.to_string(), | ||
| JsonValue::Number(n) => { | ||
| if n.is_finite() { | ||
| n.to_string() | ||
| } else { | ||
| "0".to_string() | ||
| } | ||
| } | ||
| JsonValue::String(s) => format!("\"{}\"", s), | ||
| JsonValue::Array(arr) => { | ||
| let items: Vec<String> = arr.iter().map(|v| v.to_json_string()).collect(); | ||
| format!("[{}]", items.join(",")) | ||
| } | ||
| JsonValue::Object(obj) => { | ||
| let items: Vec<String> = obj | ||
| .iter() | ||
| .map(|(k, v)| { | ||
| let key = k.clone(); | ||
| format!("\"{}\":{}", key, v.to_json_string()) | ||
| }) | ||
| .collect(); | ||
| format!("{{{}}}", items.join(",")) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| fuzz_target!(|value: JsonValue| { | ||
| let json_string = value.to_json_string(); | ||
| fuzz_target!(|value: ArbitraryValue| { | ||
| let json_string = value.to_string(); | ||
| let mut deserializer = serde_json::Deserializer::from_str(&json_string); | ||
| let _ = IValue::deserialize(&mut deserializer); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.