Skip to content

Commit

Permalink
Codegen a nullptr check when forwarding from component to datatype (#…
Browse files Browse the repository at this point in the history
…7430)

### What
We already have a similar check in our builders, but when a component
forwards to the datatype builder, we need a similar check.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7430?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7430?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!
* [x] If have noted any breaking changes to the log API in
`CHANGELOG.md` and the migration guide

- [PR Build Summary](https://build.rerun.io/pr/7430)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
  • Loading branch information
jleibs authored Sep 17, 2024
1 parent 17fb079 commit 4faea26
Show file tree
Hide file tree
Showing 83 changed files with 1,037 additions and 197 deletions.
8 changes: 7 additions & 1 deletion crates/build/re_types_builder/src/codegen/cpp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,13 @@ fn to_arrow_method(
(
true,
quote! {
return Loggable<#forwarded_type>::to_arrow(&instances->#field_name, num_instances);
if (num_instances == 0) {
return Loggable<#forwarded_type>::to_arrow(nullptr, 0);
} else if (instances == nullptr) {
return rerun::Error(ErrorCode::UnexpectedNullArgument, "Passed array instances is null when num_elements > 0.");
} else {
return Loggable<#forwarded_type>::to_arrow(&instances->#field_name, num_instances);
}
},
)
} else {
Expand Down
14 changes: 13 additions & 1 deletion rerun_cpp/src/rerun/blueprint/components/active_tab.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions rerun_cpp/src/rerun/blueprint/components/auto_layout.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions rerun_cpp/src/rerun/blueprint/components/auto_space_views.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion rerun_cpp/src/rerun/blueprint/components/column_share.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion rerun_cpp/src/rerun/blueprint/components/grid_columns.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions rerun_cpp/src/rerun/blueprint/components/included_content.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions rerun_cpp/src/rerun/blueprint/components/included_space_view.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions rerun_cpp/src/rerun/blueprint/components/interactive.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion rerun_cpp/src/rerun/blueprint/components/query_expression.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion rerun_cpp/src/rerun/blueprint/components/root_container.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion rerun_cpp/src/rerun/blueprint/components/row_share.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion rerun_cpp/src/rerun/blueprint/components/space_view_class.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions rerun_cpp/src/rerun/blueprint/components/space_view_maximized.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions rerun_cpp/src/rerun/blueprint/components/space_view_origin.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion rerun_cpp/src/rerun/blueprint/components/timeline_name.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4faea26

Please sign in to comment.