Skip to content

Commit 1319922

Browse files
committed
wrap RBIMPL_ASSERT_OR_ASSUME in an ifdef as it isn't available on Ruby 2.7
1 parent 2fa9417 commit 1319922

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

ext/json/ext/generator/generator.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,10 @@ ALWAYS_INLINE(static) char *copy_remaining_bytes(search_state *search, unsigned
304304
// Optimistically copy the remaining 'len' characters to the output FBuffer. If there are no characters
305305
// to escape, then everything ends up in the correct spot. Otherwise it was convenient temporary storage.
306306
#if defined(__has_builtin) && __has_builtin(__builtin_memcpy)
307+
308+
#ifdef RBIMPL_ASSERT_OR_ASSUME
307309
RBIMPL_ASSERT_OR_ASSUME(len < 16);
310+
#endif
308311

309312
if (vec_len == 16 && len >= 4) {
310313
// If __builtin_memcpy is available, use it to copy between SIMD_MINIMUM_THRESHOLD and vec_len-1 bytes.

0 commit comments

Comments
 (0)