Skip to content

Commit

Permalink
Merge pull request AcademySoftwareFoundation#1954 from AcademySoftwar…
Browse files Browse the repository at this point in the history
…eFoundation/feature/ubsan_fix

Disable undefined behavior checks in transformValues()
  • Loading branch information
danrbailey authored Oct 29, 2024
2 parents cc48dc0 + 49cc7de commit ff9463c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 8 additions & 6 deletions openvdb/openvdb/tools/ValueTransformer.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,14 @@ inline void foreach(const IterT& iter, const XformOp& op,
/// consider using @c tbb::parallel_for() or @c tbb::parallel_reduce() in conjunction
/// with a tree::IteratorRange that wraps a grid or tree iterator.
template<typename InIterT, typename OutGridT, typename XformOp>
inline void transformValues(const InIterT& inIter, OutGridT& outGrid,
inline OPENVDB_UBSAN_SUPPRESS("undefined")
void transformValues(const InIterT& inIter, OutGridT& outGrid,
XformOp& op, bool threaded = true, bool shareOp = true,
MergePolicy merge = MERGE_ACTIVE_STATES);

template<typename InIterT, typename OutGridT, typename XformOp>
inline void transformValues(const InIterT& inIter, OutGridT& outGrid,
inline OPENVDB_UBSAN_SUPPRESS("undefined")
void transformValues(const InIterT& inIter, OutGridT& outGrid,
const XformOp& op, bool threaded = true, bool shareOp = true,
MergePolicy merge = MERGE_ACTIVE_STATES);

Expand Down Expand Up @@ -585,8 +587,8 @@ class CopyableOpTransformer


template<typename InIterT, typename OutGridT, typename XformOp>
inline void
transformValues(const InIterT& inIter, OutGridT& outGrid, XformOp& op,
inline OPENVDB_UBSAN_SUPPRESS("undefined")
void transformValues(const InIterT& inIter, OutGridT& outGrid, XformOp& op,
bool threaded, bool shared, MergePolicy merge)
{
using Adapter = TreeAdapter<OutGridT>;
Expand All @@ -603,8 +605,8 @@ transformValues(const InIterT& inIter, OutGridT& outGrid, XformOp& op,
}

template<typename InIterT, typename OutGridT, typename XformOp>
inline void
transformValues(const InIterT& inIter, OutGridT& outGrid, const XformOp& op,
inline OPENVDB_UBSAN_SUPPRESS("undefined")
void transformValues(const InIterT& inIter, OutGridT& outGrid, const XformOp& op,
bool threaded, bool /*share*/, MergePolicy merge)
{
using Adapter = TreeAdapter<OutGridT>;
Expand Down
1 change: 0 additions & 1 deletion openvdb/openvdb/unittest/TestTools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,6 @@ struct FloatToVec

}


TEST_F(TestTools, testTransformValues)
{
using openvdb::CoordBBox;
Expand Down

0 comments on commit ff9463c

Please sign in to comment.