From 6b4d761818b79a6fc17607e15d939154b4d8314f Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 15 Dec 2025 11:22:55 +0100 Subject: feat: New Nullable system, and improved Vettable system. Signed-off-by: Amlal El Mahrouss --- src/kernel/NeKit/ErrorOr.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/kernel/NeKit/ErrorOr.h') diff --git a/src/kernel/NeKit/ErrorOr.h b/src/kernel/NeKit/ErrorOr.h index 4e43cb27..5fa8054b 100644 --- a/src/kernel/NeKit/ErrorOr.h +++ b/src/kernel/NeKit/ErrorOr.h @@ -25,10 +25,15 @@ class ErrorOr final { public: using RefType = Ref; using Type = T; + using TypePtr = T*; + + explicit ErrorOr(ErrorT err) : mRef((T*) RTL_ALLOCA(sizeof(T))), mId(err) { + // AMLALE: Invalidate the value of mRef to make computational evaluations false. + mRef = nullptr; + } - explicit ErrorOr(ErrorT err) : mRef((T*) RTL_ALLOCA(sizeof(T))), mId(err) {} explicit ErrorOr(nullPtr) {} - explicit ErrorOr(Type* klass) : mRef(klass) {} + explicit ErrorOr(TypePtr klass) : mRef(klass) {} explicit ErrorOr(Type klass) : mRef(klass) {} ErrorOr& operator=(const ErrorOr&) = default; -- cgit v1.2.3