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

[Bugfix][CRT] Return error code on error from ModuleGetFunction #17097

Conversation

Lunderberg
Copy link
Contributor

Prior to this commit, ModuleGetFunction returned zero if called with an incorrect number of arguments, or with incorrect type codes. This incorrectly indicated that the module was inspected, and did not contain the requested function.

This commit corrects the implementation of ModuleGetFunction to instead call set an error message with TVMAPISetLastError, then to return an appropriate error code.

Prior to this commit, `ModuleGetFunction` returned zero if called with
an incorrect number of arguments, or with incorrect type codes.  This
incorrectly indicated that the module was inspected, and did not
contain the requested function.

This commit corrects the implementation of `ModuleGetFunction` to
instead call set an error message with `TVMAPISetLastError`, then to
return an appropriate error code.
@Lunderberg
Copy link
Contributor Author

This change is split out from #16183 as an independent change for ease of review.

Copy link
Member

@yongwww yongwww left a comment

Choose a reason for hiding this comment

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

lgtm

@Lunderberg Lunderberg merged commit 9a7b148 into apache:main Jun 18, 2024
19 checks passed
@Lunderberg Lunderberg deleted the bugfix_crt_error_code_from_modulegetfunction branch June 18, 2024 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants