Skip to content

Rewrite prefix/postfix increment/decrement operators for int and long.#2785

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_937420090
Open

Rewrite prefix/postfix increment/decrement operators for int and long.#2785
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_937420090

Conversation

@copybara-service

Copy link
Copy Markdown

Rewrite prefix/postfix increment/decrement operators for int and long.

This change introduces inline helper functions (JrePreIncInt, JrePostIncInt, etc.) to perform increment and decrement operations on byte, char, short, int, long that ensure that integer overflow behavior matches Java's semantics, where overflow wraps around. The OperatorRewriter is updated to replace native C/Objective-C ++ and -- operators with calls to these new helper functions.

This change introduces inline helper functions (JrePreIncInt, JrePostIncInt, etc.) to perform increment and decrement operations on byte, char, short, int, long that ensure that integer overflow behavior matches Java's semantics, where overflow wraps around. The OperatorRewriter is updated to replace native C/Objective-C ++ and -- operators with calls to these new helper functions.

PiperOrigin-RevId: 937420090
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants