[PATCH] D105866: [lld-macho] Use intermediate arrays to store opcodes

Vincent Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 15 15:43:47 PDT 2021


thevinster marked 7 inline comments as done.
thevinster added inline comments.


================
Comment at: lld/MachO/SyntheticSections.cpp:334
+static void flushOpcodes(BindOpcodeOpt &op, raw_svector_ostream &os) {
+  uint8_t opcode = op.opcode & 0xF0;
+  switch (opcode) {
----------------
int3 wrote:
> I don't think there's anything to mask here, since we are explicitly setting `op.opcode` to one of the opcode values minus any extra data. But we could do an assert to be on the safe side :)
Doesn't this operation `BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB | seg->index` mean it's possible that extra data could be embedded in an opcode value? Otherwise, why perform `seg->index` in the first place?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105866/new/

https://reviews.llvm.org/D105866



More information about the llvm-commits mailing list