Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

use a volatile pointer to call slp_switch #183

Closed
@akruis

Description

@akruis

If the internal stack transfer function slp_switch() is implemented using gcc/clang inline assembly, the inline assembly depends on the register allocation rules defined in the ABI-specification of the respective platform. Now if compiler inlines the function, the register allocation rules no longer apply and the behaviour is undefined.

Experiments show that the only reliable way to prevent inlining is to call slp_switch() using a volatile pointer. Here is the patch.

This has the additional advantage that slp_switch() now can be declared static, which reduces namespace pollution.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions