Skip to content

Commit

Permalink
allow undefined EnvMap enum values for future proofing
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
  • Loading branch information
peterhillman authored and cary-ilm committed Aug 9, 2020
1 parent 485b5fe commit 2f83442
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions OpenEXR/IlmImf/ImfEnvmapAttribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,18 @@ EnvmapAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int
_value = Envmap (tmp);
}

template <>
void
EnvmapAttribute::copyValueFrom (const OPENEXR_IMF_INTERNAL_NAMESPACE::Attribute &other)
#if defined (__clang__)
// _value may be an invalid value, which the clang sanitizer reports
// as undefined behavior, even though the value is acceptable in this
// context.
__attribute__((no_sanitize ("undefined")))
#endif
{
_value = cast(other).value();

}

OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT

0 comments on commit 2f83442

Please sign in to comment.