From 88fd221dcb8b63a1c5c32388a92d30d075673ae6 Mon Sep 17 00:00:00 2001 From: Mirek Fidler Date: Thu, 3 Jul 2025 10:29:01 +0200 Subject: [PATCH] Critical fixes --- uppsrc/Core/Topt.h | 8 ++++---- uppsrc/ide/clang/Visitor.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/uppsrc/Core/Topt.h b/uppsrc/Core/Topt.h index 0904452f2..a1f92a017 100644 --- a/uppsrc/Core/Topt.h +++ b/uppsrc/Core/Topt.h @@ -174,7 +174,7 @@ inline constexpr bool is_upp_guest = false; template inline typename std::enable_if_t> Relocate(T *dst, T *src) { - memcpy(dst, src, sizeof(T)); + memcpy(reinterpret_cast(dst), reinterpret_cast(src), sizeof(T)); } template @@ -189,7 +189,7 @@ template inline void InsertRelocate(T *dst, T *src, int n) { if constexpr(is_trivially_relocatable) - memmove(dst, src, n * sizeof(T)); + memmove(reinterpret_cast(dst), reinterpret_cast(src), n * sizeof(T)); else { static_assert(is_upp_guest); if(n <= 0) @@ -209,7 +209,7 @@ template inline void RemoveRelocate(T *dst, T *src, int n) { if constexpr(is_trivially_relocatable) - memmove(dst, src, n * sizeof(T)); + memmove(reinterpret_cast(dst), reinterpret_cast(src), n * sizeof(T)); else { static_assert(is_upp_guest); T *lim = src + n; @@ -538,4 +538,4 @@ int CompareMap(const C& a, const C& b) return q; } return SgnCompare(a.GetCount(), b.GetCount()); -} +} \ No newline at end of file diff --git a/uppsrc/ide/clang/Visitor.cpp b/uppsrc/ide/clang/Visitor.cpp index 27bb32465..c04af935d 100644 --- a/uppsrc/ide/clang/Visitor.cpp +++ b/uppsrc/ide/clang/Visitor.cpp @@ -35,7 +35,7 @@ public: String Name(); String Id(); String Bases(); - + CXCursor GetCursor() { return cursor; } ClangCursorInfo(CXCursor cursor, CXPrintingPolicy pp_id); @@ -316,7 +316,7 @@ bool ClangVisitor::ProcessNode(CXCursor cursor) r.nspace = ci.Nspace(); r.bases = ci.Bases(); r.isvirtual = kind == CXCursor_CXXMethod && clang_CXXMethod_isVirtual(cursor); - r.isstatic = clang_Cursor_getStorageClass(cursor) == CX_SC_Static; + r.isstatic = (IsFunction(r.kind) || IsVariable(r.kind)) && clang_Cursor_getStorageClass(cursor) == CX_SC_Static; if(findarg(r.kind, CXCursor_Constructor, CXCursor_Destructor) >= 0) { int q = r.id.Find('('); @@ -352,7 +352,7 @@ bool ClangVisitor::ProcessNode(CXCursor cursor) if(findarg(ci.Kind(), CXCursor_CXXBaseSpecifier, CXCursor_TemplateRef) < 0) // suppress template untyping for : WithDlgLayout q = tfn.Find(ref_loc); ClangCursorInfo ref_ci(q >= 0 ? tfn[q].cursor : ref, pp_id); - + ReferenceItem rm; rm.pos = sl.pos; rm.id = ref_ci.Id(); @@ -376,7 +376,7 @@ bool ClangVisitor::ProcessNode(CXCursor cursor) info.GetAdd(sl.path).refs.Add(rm); } }; - + if(clang_getCursorKind(ref) == CXCursor_OverloadedDeclRef) for(unsigned int i = 0; i < clang_getNumOverloadedDecls(ref); i++) AddRef(clang_getOverloadedDecl(ref, i));