Skip to content

cgen: fix missing return code generated#22839

Merged
spytheman merged 2 commits intovlang:masterfrom
felipensp:fix_missing_return_code
Nov 12, 2024
Merged

cgen: fix missing return code generated#22839
spytheman merged 2 commits intovlang:masterfrom
felipensp:fix_missing_return_code

Conversation

@felipensp
Copy link
Copy Markdown
Member

@felipensp felipensp commented Nov 12, 2024

@felipensp felipensp marked this pull request as ready for review November 12, 2024 03:17
if ((s).len != 0) {
_result_ok(&(string[]) { s }, (_result*)(&_t2), sizeof(string));
} else {
return (_result_string){ .is_error=true, .err=_v_error(_SLIT("empty")), .data={EMPTY_STRUCT_INITIALIZATION} };
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Afaik just this line matters, the rest can make the test more brittle.
Am I missing something?

Copy link
Copy Markdown
Contributor

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Excellent work.

@spytheman spytheman merged commit fe5609d into vlang:master Nov 12, 2024
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.

Returning a return strange behaviour

2 participants