From e27a21874648bc9d426dda704a8a3ca81991195a Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 3 Nov 2024 15:17:59 +0100 Subject: [PATCH] Fixed some issues with `null_check_test`` --- lang/README.md | 22 +++++++++++++++++++--- lang/tests/son_tests_null_check_test.txt | 0 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 lang/tests/son_tests_null_check_test.txt diff --git a/lang/README.md b/lang/README.md index 5c7d021..7aae452 100644 --- a/lang/README.md +++ b/lang/README.md @@ -1042,16 +1042,32 @@ main := fn(): uint { } ``` +#### inlining_loops +```hb +x := 1 + +foo := fn(): int { + loop if true break + x = 0 +} + +main := fn(): int { + @inline(foo) + return x +} +``` + #### null_check_test ```hb -main := fn(): unit { +main := fn(): uint { ptr := @as(?^uint, null) - *ptr = 0 + value := 0 + ptr = &value if ptr == null { return 1 } - + return *ptr } ``` diff --git a/lang/tests/son_tests_null_check_test.txt b/lang/tests/son_tests_null_check_test.txt new file mode 100644 index 0000000..e69de29