Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Issue 1311653003: Add UBSAN build option and fix undefined behaviour errors. (Closed)

Created:
5 years, 3 months ago by ascull
Modified:
5 years, 3 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add UBSAN build option and fix undefined behaviour errors. 1. The assembler tried to write to unaligned addresses but memcpy fixes this. 2. The InstKind and OperandKind enums allowed target specific kinds that did not fall in the defined range. Defining the maximum target kind in the enum sorts this problem. BUG= R=stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=6ef7949448bbe3fdb1a0cf3dcbd32fd46c4baf9d

Patch Set 1 #

Patch Set 2 : Neater way to set Target_Max #

Total comments: 11

Patch Set 3 : #

Total comments: 2

Patch Set 4 : Remove x-macros #

Total comments: 1

Patch Set 5 : Fix after native_client pull #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -53 lines) Patch
M Makefile.standalone View 1 2 3 4 2 chunks +18 lines, -0 lines 0 comments Download
M src/IceAssembler.h View 1 2 1 chunk +11 lines, -4 lines 0 comments Download
M src/IceConverter.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M src/IceInst.h View 1 2 3 4 5 chunks +30 lines, -31 lines 0 comments Download
M src/IceOperand.h View 1 2 3 4 6 chunks +19 lines, -16 lines 0 comments Download
M src/IceRNG.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 9 (1 generated)
ascull
5 years, 3 months ago (2015-09-04 20:55:46 UTC) #2
Jim Stichnoth
https://codereview.chromium.org/1311653003/diff/20001/src/IceAssembler.h File src/IceAssembler.h (right): https://codereview.chromium.org/1311653003/diff/20001/src/IceAssembler.h#newcode103 src/IceAssembler.h:103: memcpy(reinterpret_cast<void *>(Cursor), &Value, sizeof(T)); Have you checked the effect ...
5 years, 3 months ago (2015-09-04 21:32:49 UTC) #3
ascull
https://codereview.chromium.org/1311653003/diff/20001/src/IceAssembler.h File src/IceAssembler.h (right): https://codereview.chromium.org/1311653003/diff/20001/src/IceAssembler.h#newcode103 src/IceAssembler.h:103: memcpy(reinterpret_cast<void *>(Cursor), &Value, sizeof(T)); On 2015/09/04 21:32:48, stichnot wrote: ...
5 years, 3 months ago (2015-09-05 00:00:48 UTC) #4
Jim Stichnoth
https://codereview.chromium.org/1311653003/diff/20001/src/IceAssembler.h File src/IceAssembler.h (right): https://codereview.chromium.org/1311653003/diff/20001/src/IceAssembler.h#newcode103 src/IceAssembler.h:103: memcpy(reinterpret_cast<void *>(Cursor), &Value, sizeof(T)); On 2015/09/05 00:00:48, ascull wrote: ...
5 years, 3 months ago (2015-09-05 01:03:22 UTC) #5
John
https://codereview.chromium.org/1311653003/diff/40001/src/IceInst.h File src/IceInst.h (right): https://codereview.chromium.org/1311653003/diff/40001/src/IceInst.h#newcode74 src/IceInst.h:74: #define X(n) Target##n, If I understand what Jim said, ...
5 years, 3 months ago (2015-09-08 15:57:11 UTC) #6
ascull
https://codereview.chromium.org/1311653003/diff/20001/src/IceInst.h File src/IceInst.h (right): https://codereview.chromium.org/1311653003/diff/20001/src/IceInst.h#newcode75 src/IceInst.h:75: TARGETKINDS_INSTS_TABLE On 2015/09/05 01:03:22, stichnot wrote: > On 2015/09/05 ...
5 years, 3 months ago (2015-09-08 17:29:26 UTC) #7
Jim Stichnoth
lgtm https://codereview.chromium.org/1311653003/diff/60001/src/IceOperand.h File src/IceOperand.h (right): https://codereview.chromium.org/1311653003/diff/60001/src/IceOperand.h#newcode54 src/IceOperand.h:54: kTarget_Max = kTarget + MaxTargetKinds, What do you ...
5 years, 3 months ago (2015-09-08 22:10:32 UTC) #8
ascull
5 years, 3 months ago (2015-09-09 22:50:46 UTC) #9
Message was sent while issue was closed.
Committed patchset #5 (id:80001) manually as
6ef7949448bbe3fdb1a0cf3dcbd32fd46c4baf9d (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698