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

Normalize missing entry case #659

Merged
merged 4 commits into from Feb 17, 2022
Merged

Normalize missing entry case #659

merged 4 commits into from Feb 17, 2022

Conversation

breathx
Copy link
Member

@breathx breathx commented Feb 16, 2022

Resolves #640.

@gear-tech/dev

Release Notes: If some of entry point (init, handle or handle_reply) isn't provided, it means now that this function is an empty function.

This code ⬇️

#![no_std]

use gstd::msg;

#[no_mangle]
pub unsafe extern "C" fn handle() {
    msg::reply_bytes("Handle", 0, 0);
}

now equals this one ⬇️

#![no_std]

use gstd::msg;

#[no_mangle]
pub unsafe extern "C" fn init() { }

#[no_mangle]
pub unsafe extern "C" fn handle() {
    msg::reply_bytes("Handle", 0, 0);
}

#[no_mangle]
pub unsafe extern "C" fn handle_reply() { }

It used to cause panic.

@breathx breathx marked this pull request as ready for review February 16, 2022 13:23
@breathx breathx added A0-pleasereview PR is ready to be reviewed by the team D1-core Gear Core labels Feb 16, 2022
@breathx breathx added A2-mergeoncegreen PR is ready to merge after CI passes and removed A0-pleasereview PR is ready to be reviewed by the team labels Feb 17, 2022
@shamilsan shamilsan added B1-releasenotes The feature deserves to be added to the Release Notes Wiki update Use this label if PR requires update in Wiki labels Feb 17, 2022
@breathx breathx merged commit ec0c914 into master Feb 17, 2022
@breathx breathx deleted the dn-missing-entry branch February 17, 2022 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A2-mergeoncegreen PR is ready to merge after CI passes B1-releasenotes The feature deserves to be added to the Release Notes D1-core Gear Core Wiki update Use this label if PR requires update in Wiki
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow absence of entry point for program
5 participants