summaryrefslogtreecommitdiffhomepage
path: root/dev
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-08-30 19:58:41 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-08-30 19:58:41 +0200
commit4bc0d37c17a56db17b19f3d2d410475d61e8f159 (patch)
tree978022dfa7b4aedea140dc47ae657dec2c6610b9 /dev
parenta9d87cbd143b05cc3de711d84401f8ef514f3aa3 (diff)
[FIX] Fix Ref class, which didn't validate fClass correctly.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'dev')
-rw-r--r--dev/ZKA/NewKit/Ref.hxx3
-rw-r--r--dev/ZKA/Sources/CodeManager.cxx2
2 files changed, 3 insertions, 2 deletions
diff --git a/dev/ZKA/NewKit/Ref.hxx b/dev/ZKA/NewKit/Ref.hxx
index 3764611c..f23cfc08 100644
--- a/dev/ZKA/NewKit/Ref.hxx
+++ b/dev/ZKA/NewKit/Ref.hxx
@@ -30,7 +30,7 @@ namespace Kernel
Ref& operator=(T ref)
{
if (!fClass)
- fClass = (T*)mm_new_ke_heap(sizeof(T), false, false);
+ return *this;
*fClass = ref;
return *this;
@@ -39,6 +39,7 @@ namespace Kernel
public:
T& operator->() const
{
+ MUST_PASS(*fClass);
return *fClass;
}
diff --git a/dev/ZKA/Sources/CodeManager.cxx b/dev/ZKA/Sources/CodeManager.cxx
index ae4354c8..4d478a7a 100644
--- a/dev/ZKA/Sources/CodeManager.cxx
+++ b/dev/ZKA/Sources/CodeManager.cxx
@@ -23,7 +23,7 @@ namespace Kernel
proc.Kind = PROCESS_HEADER_BLOCK::kAppKind;
rt_copy_memory((VoidPtr)processName, proc.Name, rt_string_len(proc.Name));
- Ref<PROCESS_HEADER_BLOCK> refProc = proc;
+ Ref<PROCESS_HEADER_BLOCK> refProc{proc};
return ProcessScheduler::The().Leak().Add(refProc);
}