This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Use uint8_t for single byte values to match the spec
ClosedPublic

Authored by sbc100 on Feb 28 2018, 5:11 PM.

Details

Summary

The original BinaryEncoding.md document used to specify that
these values were varint7, but the official spec lists them
explicitly as single byte values and not LEB.

A similar change for wabt is in flight:
https://github.com/WebAssembly/wabt/pull/782

And also lld:
https://reviews.llvm.org/D43922

Diff Detail

Repository
rL LLVM

Event Timeline

sbc100 created this revision.Feb 28 2018, 5:11 PM
sbc100 edited the summary of this revision. (Show Details)Feb 28 2018, 5:12 PM
dschuff accepted this revision.Mar 1 2018, 9:55 AM

I'm fine with doing this change since it does reflect the spec. Although IIRC the relevant types don't yet have any values over 128 and we've kept it that way so we can always upgrade to varint when we need to. So in principle we could keep the code using varint and then it won't have to change in the future.

This revision is now accepted and ready to land.Mar 1 2018, 9:55 AM

I'm fine with doing this change since it does reflect the spec. Although IIRC the relevant types don't yet have any values over 128 and we've kept it that way so we can always upgrade to varint when we need to. So in principle we could keep the code using varint and then it won't have to change in the future.

I'd rather match the spec than try to guess what the future brings and jump ahead of the spec.

This revision was automatically updated to reflect the committed changes.

Looks like this broke the gcc builders.. working on a fix now.