Skip to content

Commit

Permalink
Merge pull request #10 from bakervm/release/0.2.1
Browse files Browse the repository at this point in the history
Made call and ret methods public
  • Loading branch information
sphinxc0re authored Mar 14, 2018
2 parents aa7fee9 + 2504b03 commit 8364a19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "melon"
version = "0.2.0"
version = "0.2.1"
authors = ["Julian Laubstein <[email protected]>"]
description = "A library for creating retro computing platforms"
repository = "https://github.com/bakervm/melon"
Expand Down
4 changes: 2 additions & 2 deletions src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,14 +795,14 @@ impl VM {
}

/// Calls the function at the given address
fn call(&mut self, addr: Address) {
pub fn call(&mut self, addr: Address) {
let call = self.pc;
self.call_stack.push_front(call);
self.pc = addr;
}

/// Returns from a function call
fn ret(&mut self) -> Result<()> {
pub fn ret(&mut self) -> Result<()> {
let return_addr = self.call_stack
.pop_front()
.ok_or(format_err!("cannot return from an empty call stack"))?;
Expand Down

0 comments on commit 8364a19

Please sign in to comment.