Skip to content

Commit 8282f0f

Browse files
Fix an endian problem in upb that caused protoc plugins to crash on big endian platforms (#25363)
The protobuf build started failing on big endian platforms (I'm using s390x) starting with v33.0. The cmake build would fail when running `protoc` to compile test files. The errors looked like: ```bash gmake[2]: *** [CMakeFiles/upb-test.dir/build.make:85: google/protobuf/any.upb.h] Error 1 --upb_out: protoc-gen-upb: Plugin killed by signal 11. ``` I did a git bisect and the crash started with commit c36f728. The fix is to add a `_upb_Decoder_MungeInt32(val)` call on the closed enum value so it can be decoded properly later. I think this might fix #24103 but I'm not able to test it. Closes #25363 COPYBARA_INTEGRATE_REVIEW=#25363 from linux-on-ibm-z:upb-decode-endian 7143834 PiperOrigin-RevId: 865398323
1 parent 79bbf1d commit 8282f0f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

upb/wire/decode.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,7 @@ const char* _upb_Decoder_DecodeWireValue(upb_Decoder* d, const char* ptr,
938938
*op = kUpb_DecodeOp_UnknownField;
939939
return ptr;
940940
}
941+
_upb_Decoder_MungeInt32(val);
941942
} else {
942943
_upb_Decoder_Munge(field, val);
943944
}

0 commit comments

Comments
 (0)