Skip to content

Commit

Permalink
Merge #1006
Browse files Browse the repository at this point in the history
1006: fix 1005 panic sub overflow r=MarkMcCaskey a=pventuzelo

# Description

Fix issue #1005

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Patrick Ventuzelo <[email protected]>
Co-authored-by: Patrick Ventuzelo <[email protected]>
  • Loading branch information
3 people authored Nov 27, 2019
2 parents 53f0a9c + bb16547 commit f6f8780
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## **[Unreleased]**

- [#1006](https://github.com/wasmerio/wasmer/pull/1006) Fix minor panic issue when `wasmer::compile_with` called with llvm backend
- [#1009](https://github.com/wasmerio/wasmer/pull/1009) Enable LLVM verifier for all tests, add new llvm-backend-tests crate.

## 0.11.0 - 2019-11-22
Expand Down
12 changes: 6 additions & 6 deletions lib/llvm-backend/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,12 @@ impl State {
&self,
n: usize,
) -> Result<&[(BasicValueEnum, ExtraInfo)], BinaryReaderError> {
self.stack
.get(self.stack.len() - n..)
.ok_or(BinaryReaderError {
message: "invalid value stack",
offset: -1isize as usize,
})
let new_len = self.stack.len().checked_sub(n).ok_or(BinaryReaderError {
message: "invalid value stack",
offset: -1isize as usize,
})?;

Ok(&self.stack[new_len..])
}

pub fn popn_save_extra(
Expand Down

0 comments on commit f6f8780

Please sign in to comment.