Skip to content

Commit 095877c

Browse files
committed
[Offload] Fix isValidBinary segfault on host platform
Summary: Need to verify this actually has a device. We really need to rework this to point to a real impolementation, or streamline it to handle this automatically.
1 parent 24d41c1 commit 095877c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

offload/liboffload/src/OffloadImpl.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,8 +1004,9 @@ Error olCreateProgram_impl(ol_device_handle_t Device, const void *ProgData,
10041004
Error olIsValidBinary_impl(ol_device_handle_t Device, const void *ProgData,
10051005
size_t ProgDataSize, bool *IsValid) {
10061006
StringRef Buffer(reinterpret_cast<const char *>(ProgData), ProgDataSize);
1007-
*IsValid = Device->Device->Plugin.isDeviceCompatible(
1008-
Device->Device->getDeviceId(), Buffer);
1007+
*IsValid = Device->Device ? Device->Device->Plugin.isDeviceCompatible(
1008+
Device->Device->getDeviceId(), Buffer)
1009+
: false;
10091010
return Error::success();
10101011
}
10111012

0 commit comments

Comments
 (0)