[PATCH] D64612: [WebAssembly] i32.const operands should be signed

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 19:47:01 PDT 2019


aheejin accepted this revision.
aheejin added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lld/test/wasm/data-segments.ll:91
 ; PASSIVE-NEXT:        Locals:          []
-; PASSIVE-NEXT:        Body:            4180084100411CFC080000FC0900419C084100410DFC080100FC09010B
+; PASSIVE-NEXT:        Body:            41800841004114FC080000FC090041940841004190CE00FC080100FC090141A4D6004100410DFC080200FC09020B
 ; PASSIVE-NEXT:  - Type:            DATA
----------------
It'd be better if we can get disassembly, but it seems to be not fully working yet


================
Comment at: lld/wasm/Writer.cpp:661
         writeU8(os, WASM_OPCODE_I32_CONST, "i32.const");
-        writeUleb128(os, s->startVA, "destination address");
+        writeSleb128(os, uint32_t(s->startVA), "destination address");
         // source segment offset
----------------
Isn't [[ https://github.com/llvm/llvm-project/blob/c46d78d1b7a06aad11f8810279271224fc8466af/lld/wasm/OutputSegment.h#L39 | `OutputSegment::startVA` ]] already a `uint32_t`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64612





More information about the llvm-commits mailing list