Commit Graph
26 Commits
Author SHA1 Message Date
Sergey Shulepov 19760b5835 Fix counting of the local variables
The code assumed that the number of `Local` and number of locals is the
same thing. In reality though it is not. `Local` actually represents a
group of locals with the same type. The group can declare more than one
variable and the number of them is returned by `Local::count`.

In this PR we acknowledge this fact. Along the way we add a checked
arithmetic for locals_count and max_stack_height summation.
2021-06-09 19:22:40 +02:00
Sergey Shulepov 717aa8f0cb Add BLESS env option
Right now if there is a diff between the actual and expected results,
the expected file will be overwritten. This may be annoying. To make it
controlled we introduce BLESS option.

This means that the expected files won't be regenerated unless this
environment variable is set.

Therefore to regenerate the tests use:

    BLESS=1 cargo test
2021-06-09 19:17:54 +02:00
Sergei Pepyakin bbcc495ccc Merge pull request #116 from paritytech/small-tests
A couple of small tests.
2019-04-03 14:43:29 +02:00
Sergei Pepyakin 8ecbc8ddcc Merge pull request #114 from paritytech/ret
"return_ "-> "ret" in public api
2019-01-24 09:54:46 +01:00
Sergei Pepyakin 59384e09d0 Merge pull request #109 from holygits/fix/108
Preserve 'deploy' export for Substrate binaries
2019-01-23 22:21:17 +01:00
Sergey Pepyakin 836ec93008 Introduce substrate contracts support. 2018-09-30 18:24:36 +01:00
Sergey Pepyakin db80363d56 Merge pull request #91 from paritytech/bump-version-0.2.2
Bump version up to 0.2.2
2018-07-02 16:39:06 +03:00
Sergey Pepyakin bbb6c6078a Bump version up to 0.2.2. 2018-07-02 15:21:37 +03:00
Sergey Pepyakin f4b75bd840 Merge pull request #88 from sphinxc0re/patch-1
Fixed typo
2018-06-11 16:55:26 +03:00
Sergey Pepyakin 60a7776f3a Merge pull request #77 from paritytech/sorpaas/nostd
Executable refactoring and no_std support
2018-05-15 17:03:53 +03:00
Sergey Pepyakin 867a6a185d Use parity-wasm 0.30 instead of git 2018-05-15 16:54:02 +03:00
Sergey Pepyakin e9169f2d64 Merge pull request #73 from paritytech/refactor-gas-metering
Refactor gas metering.
2018-04-25 21:45:27 +03:00
Sergey Pepyakin 6c655fadcd Refactor gas metering. 2018-04-24 16:05:13 +03:00
Sergey Pepyakin aa84f4d2a5 Merge pull request #72 from paritytech/import-section-missing
Don't panic on missing import section
2018-04-18 21:04:01 +03:00
Sergey Pepyakin 1cebd86bf6 Add 'target' for trace logging in max_height
This should greatly reduce log amount when running parity with trace=wasm.
2018-03-25 14:05:42 +03:00
Sergey Pepyakin 9527b969a4 Impl stack height limiter (#64)
* Initial implementation

* Add wasm-stack-height binary

* Fixes and tracing.

* Doc fixes.

* Fix type resolving for thunks.

* Fix thunk numbering.

* Don't generate thunks for fns with stack_cost = 0

* Diff tests.

* Add table tests.

* Add global test.

* Make tests deterministic.

* Refactoring.

* Clean and refactor.

* Rename Context → Stack in stach_height.

* Don't generate call wrappers if stack_cost = 0

* Errors instead of panics.

* Add with_stack_limit function.

* Fix thunk generation.

* Pass the stack height limit as separate value.

* Use .unwrap_or_default() in diff.rs.

* Remove redundant &.

* Remove simple_test.

* Remove variants of the Error.

* `resolve_func_type` returns an Error.

* Don't unwrap for .last()

* Remove stack_limit from rules::Set

* Rename max_height::compute.
2018-02-27 16:52:37 +03:00
Sergey Pepyakin 69be61876d Ignore .idea 2018-02-22 19:58:45 +03:00
Sergey Pepyakin 9e51343948 Merge pull request #60 from paritytech/float
Add rules with option to forbid specific operations
2018-02-19 19:58:44 +03:00
Sergey Pepyakin e773d5c946 Don't externalize and don't keep setTempRet0
We don't need to do externalization, because we started to explicitly extern all needed functions.
2017-11-14 16:29:53 +03:00
Sergey Pepyakin d2c1d92e2b Don't externalize setTempRet0
It is not longer needed, as we stopped to do legalization for JS FFI.
2017-11-09 22:25:27 +03:00
Sergey Pepyakin b7dd10e2bc Update README.md 2017-11-07 12:17:28 +03:00
Sergey Pepyakin 023fe5e8cb Externalize mem ops 2017-11-06 19:25:03 +03:00
Sergey Pepyakin 088901fa1b Add .editorconfig 2017-11-01 16:37:50 +03:00
Sergey Pepyakin ceac3eeed1 Add .travis.yml 2017-11-01 16:12:40 +03:00
Sergey Pepyakin 4f81a756c9 Remove "nondeterminism-check" binary 2017-11-01 15:52:51 +03:00
Sergey Pepyakin a186c81c03 Bump parity-wasm to 0.15 2017-11-01 15:52:37 +03:00