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

feat(wasm-builder): check more gear requirements for code at build #3221

Closed
wants to merge 2 commits into from

Conversation

StackOverflowExcept1on
Copy link
Member

@StackOverflowExcept1on StackOverflowExcept1on commented Sep 6, 2023

Resolves #2819

TODO:

  • checks for handle_signal
  • code refactoring, put something into separate methods

Test code:

#![no_std]

use gstd::{msg, ActorId};

static mut INITIATOR: ActorId = ActorId::zero();

#[no_mangle]
extern "C" fn init() {
    let _ = msg::reply("init", 0);
}

#[no_mangle]
extern "C" fn handle() {
    let _ = msg::reply("handle", 0);
}

#[no_mangle]
extern "C" fn handle_reply() {
    let _ = msg::reply("handle_reply", 0);
}

fn f() {
    if msg::value() == 123 {
        unsafe { INITIATOR = msg::source() };
    }
}

#[no_mangle]
extern "C" fn handle_signal() {
    f();
}
      Finished release [optimized] target(s) in 0.66s
  error: forbidden function `gr_source` has been detected in the signal handler

@StackOverflowExcept1on StackOverflowExcept1on added A1-inprogress Issue is in progress or PR draft is not ready to be reviewed D5-tooling Helper tools and utilities labels Sep 6, 2023
@StackOverflowExcept1on StackOverflowExcept1on marked this pull request as ready for review September 8, 2023 07:11
@StackOverflowExcept1on StackOverflowExcept1on added A0-pleasereview PR is ready to be reviewed by the team and removed A1-inprogress Issue is in progress or PR draft is not ready to be reviewed labels Sep 8, 2023
@StackOverflowExcept1on StackOverflowExcept1on added A3-gotissues PR occurred to have issues after the review and removed A0-pleasereview PR is ready to be reviewed by the team labels Sep 8, 2023
@StackOverflowExcept1on StackOverflowExcept1on deleted the av/handle-signal-checks branch December 1, 2023 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A3-gotissues PR occurred to have issues after the review D5-tooling Helper tools and utilities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check all gear requirements for code at build
1 participant