aboutsummaryrefslogtreecommitdiff
path: root/pk
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-02-08 15:51:20 -0800
committerGitHub <noreply@github.com>2022-02-08 15:51:20 -0800
commitbc6e624fe1167b088af5694bb74eb68d61dde8ba (patch)
tree1d4cd2f381151d063045f1f6dd1bc65827b0ae8d /pk
parent90191ad93eac47d61ab9cc89084050ad1541d160 (diff)
downloadpk-bc6e624fe1167b088af5694bb74eb68d61dde8ba.zip
pk-bc6e624fe1167b088af5694bb74eb68d61dde8ba.tar.gz
pk-bc6e624fe1167b088af5694bb74eb68d61dde8ba.tar.bz2
Fix local variable register usage for ra (#268)
See https://gcc.gnu.org/onlinedocs/gcc/Local-Register-Variables.html#Local-Register-Variables "Other than when invoking the Extended asm, the contents of the specified register are not guaranteed." Also revert 90191ad93eac47d61ab9cc89084050ad1541d160.
Diffstat (limited to 'pk')
-rw-r--r--pk/console.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/pk/console.c b/pk/console.c
index 475a93b..cf40a0a 100644
--- a/pk/console.c
+++ b/pk/console.c
@@ -64,6 +64,5 @@ void do_panic(const char* s, ...)
void kassert_fail(const char* s)
{
- register uintptr_t ra asm ("ra");
- do_panic("assertion failed @ %p: %s\n", ra, s);
+ do_panic("assertion failed @ %p: %s\n", __builtin_return_address(0), s);
}