Randomize type declaration order

This commit is contained in:
2025-03-12 23:56:54 +01:00
parent c9a8ecdc0a
commit ac084be7f5
5 changed files with 48 additions and 28 deletions

View File

@ -15,8 +15,6 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#pragma once
#include "elna/boot/symbol.h"
namespace elna
@ -68,7 +66,7 @@ namespace boot
new (&alias) std::weak_ptr<alias_type>(other.alias);
break;
case type_tag::primitive:
new (&primitive) std::weak_ptr<primitive_type>(other.primitive);
new (&primitive) std::shared_ptr<primitive_type>(other.primitive);
break;
case type_tag::record:
new (&record) std::shared_ptr<record_type>(other.record);
@ -101,7 +99,7 @@ namespace boot
new (&alias) std::weak_ptr<alias_type>(std::move(other.alias));
break;
case type_tag::primitive:
new (&primitive) std::weak_ptr<primitive_type>(std::move(other.primitive));
new (&primitive) std::shared_ptr<primitive_type>(std::move(other.primitive));
break;
case type_tag::record:
new (&record) std::shared_ptr<record_type>(std::move(other.record));
@ -149,6 +147,7 @@ namespace boot
case type_tag::alias:
break;
case type_tag::primitive:
this->primitive.~shared_ptr<primitive_type>();
break;
case type_tag::record:
this->record.~shared_ptr<record_type>();
@ -183,7 +182,7 @@ namespace boot
{
if (tag == type_tag::primitive)
{
return this->primitive.lock();
return this->primitive;
}
else
{