Skip to content

Commit

Permalink
Fixing the trait struct cookie assignment in Kotlin (#707)
Browse files Browse the repository at this point in the history
* Fixing a bug in kotlin code gen that crashed the JVM on GC

* updating tests

---------

Co-authored-by: Ellen Arteca <[email protected]>
  • Loading branch information
emarteca and Ellen Arteca authored Oct 10, 2024
1 parent e93cf1a commit 179b75d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ internal class DiplomatTrait_TesterTrait_Wrapper internal constructor (
vtable.run_testEnumReturn_callback = testEnumReturn;
val native_wrapper = DiplomatTrait_TesterTrait_Wrapper_Native();
native_wrapper.vtable = vtable;
native_wrapper.data_ = DiplomatJVMRuntime.buildRustCookie(vtable as Object);
native_wrapper.data_ = DiplomatJVMRuntime.buildRustCookie(native_wrapper as Object);
return DiplomatTrait_TesterTrait_Wrapper(native_wrapper);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tool/templates/kotlin/Trait.kt.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ internal class DiplomatTrait_{{trait_name}}_Wrapper internal constructor (
{% endif -%}
val native_wrapper = DiplomatTrait_{{trait_name}}_Wrapper_Native();
native_wrapper.vtable = vtable;
native_wrapper.data_ = DiplomatJVMRuntime.buildRustCookie(vtable as Object);
native_wrapper.data_ = DiplomatJVMRuntime.buildRustCookie(native_wrapper as Object);
return DiplomatTrait_{{trait_name}}_Wrapper(native_wrapper);
}
}
Expand Down

0 comments on commit 179b75d

Please sign in to comment.