Skip to content

Commit

Permalink
Replace throw with return (#49)
Browse files Browse the repository at this point in the history
* replace throw with return

* try to fix macos ci
  • Loading branch information
stuxnot authored May 7, 2024
1 parent 608c23e commit 357e81b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Build
run: NYXSTONE_LLVM_PREFIX=$(brew --prefix llvm@15) cargo build
run: RUSTFLAGS="-L$(brew --prefix zstd)/lib" NYXSTONE_LLVM_PREFIX=$(brew --prefix llvm@15) cargo build
working-directory: ${{ env.working-dir }}
- name: Run tests
run: NYXSTONE_LLVM_PREFIX=$(brew --prefix llvm@15) cargo test
run: RUSTFLAGS="-L$(brew --prefix zstd)/lib" RUSTDOCFLAGS="-L$(brew --prefix zstd)/lib" NYXSTONE_LLVM_PREFIX=$(brew --prefix llvm@15) cargo test
working-directory: ${{ env.working-dir }}

2 changes: 1 addition & 1 deletion src/nyxstone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ tl::expected<std::unique_ptr<Nyxstone>, std::string> NyxstoneBuilder::build()
// Init reusable llvm info objects
auto register_info = std::unique_ptr<llvm::MCRegisterInfo>(target->createMCRegInfo(triple.getTriple()));
if (!register_info) {
throw tl::unexpected("Could not create LLVM object (= MCRegisterInfo )");
return tl::unexpected("Could not create LLVM object (= MCRegisterInfo )");
}

llvm::MCTargetOptions target_options;
Expand Down

0 comments on commit 357e81b

Please sign in to comment.