Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return compile error (llvm) for setting immutable global #674

Merged
merged 1 commit into from
Aug 14, 2019

Conversation

bjfish
Copy link
Contributor

@bjfish bjfish commented Aug 14, 2019

No description provided.

@@ -1151,7 +1151,9 @@ impl FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator {
builder.build_store(ptr_to_value, value);
}
GlobalCache::Const { value: _ } => {
unreachable!("cannot set non-mutable globals")
return Err(CodegenError {
message: "global is immutable".to_string(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice to include more information here if it's available, like what global and what value maybe. To make debugging easier

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like having more context, I'll start thinking about this as I see more messages.

@bjfish
Copy link
Contributor Author

bjfish commented Aug 14, 2019

bors r+

bors bot added a commit that referenced this pull request Aug 14, 2019
674: Return compile error (llvm) for setting immutable global r=bjfish a=bjfish



Co-authored-by: Brandon Fish <[email protected]>
@bors bors bot merged commit 137ac20 into master Aug 14, 2019
@bors bors bot deleted the feature/fix-llvm-spec-set-immutable-global branch August 14, 2019 01:55
@Hywan Hywan added 🎉 enhancement New feature! 📦 lib-compiler-llvm About wasmer-compiler-llvm 📦 lib-spectests labels Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 enhancement New feature! 📦 lib-compiler-llvm About wasmer-compiler-llvm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants