swh:1:snp:9c27352633c4639a943e316050a7b904f57900e2
Revision 5f92df59c8ea01930d2e9e1d238806885fb2d591 authored by Raphaël Proust on 27 June 2019, 00:19:25 UTC, committed by Pierre Boutillier on 21 October 2019, 12:25:24 UTC
The Michelson documentation states that `COMPARE` pushes -1 (resp. 1)
if the top element of the stack is smaller (resp. greater) than the
second. However, the implementation can actually push a negative
number instead of -1 and a positive number instead of 1 depending on
the type and values.

This semantics should not break any code as the result of `COMPARE` is
almost always comsumed by comparison projectors such as `GT` or `LT`
who only care about the sign. However, for the sake of consistency,
this patches makes `COMPARE` return only -1, 0 or 1.

This fixes issue #546
1 parent 36fbc8d
History
Tip revision: 0157460ca60aeaf5169680cf1c26df318f10da9b authored by Romain on 16 April 2021, 13:33:51 UTC
Merge branch 'romain-tezt-protocol' into 'master'
Tip revision: 0157460
File Mode Size
.github
.gitlab
docs
emacs
scripts
src
tests_python
vendors
.dockerignore -rw-r--r-- 627 bytes
.gitattributes -rw-r--r-- 132 bytes
.gitignore -rw-r--r-- 830 bytes
.gitlab-ci.yml -rw-r--r-- 19.6 KB
.ocp-indent -rw-r--r-- 17 bytes
LICENSE -rw-r--r-- 1.1 KB
Makefile -rw-r--r-- 5.4 KB
README.md -rw-r--r-- 1.7 KB
active_protocol_versions -rw-r--r-- 6 bytes
contributing.md -rw-r--r-- 2.4 KB
dune -rw-r--r-- 191 bytes
dune-workspace -rw-r--r-- 16 bytes

README.md

back to top