Sitelet https://github.com/gtreshchev/AndroidNative/compare/main...Nocxr:AndroidNative:main
Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gtreshchev/AndroidNative
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: Nocxr/AndroidNative
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 7 commits
  • 2 files changed
  • 1 contributor

Commits on Sep 16, 2025

  1. SignatureHelper breaking on TArray fix

    0>SignatureHelper.h(78,52): Error  : returning address of local temporary object [-Werror,-Wreturn-stack-address]
    0>   78 |         GetTypeSignature() { return const_cast<ANSICHAR>(StringCast<ANSICHAR>(FString::Printf(TEXT("[%s"), *FString(GetTypeSignature<typename PassedType::ElementType>()))).Get()); }
    0>
    AI Assistant
    Diagnosis
    The error returning address of local temporary object [-Werror,-Wreturn-stack-address] is triggered by the TArray specialization of SignatureHelper::GetTypeSignature. It constructs an FString and then uses StringCast(...).Get() to obtain a pointer to a transient buffer owned by a temporary StringCast. That buffer becomes invalid as soon as the expression ends, so returning it yields a dangling pointer.
    This hits when you call CallJavaStaticMethod<TArray>(...), since it needs the JNI signature for an int32 array, which should be "[I". The faulty specialization tries to build and return that via a temporary cast.
    Fix
    Make the TArray specialization return an owning FString instead of a pointer, and build the signature directly as a TCHAR string. This avoids returning a pointer to a temporary. All concatenations are done into an FString already, so appending a FString works seamlessly.
    
    Why this resolves the error
    - No pointer to data owned by a temporary is returned anymore.
    - For TArray, this now correctly produces the JNI type signature "[I" as an FString, which is safely appended in GetTypeSignatures and GetMethodSignature.
    
    Notes
    - Other GetTypeSignature overloads return string literals (which have static storage duration), so they are safe.
    - At the final call site, you already convert the complete method signature FString to ANSICHAR just-in-time, which is safe within that expression.
    Nocxr authored Sep 16, 2025
    Configuration menu
    Copy the full SHA
    3b1d39d View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1 from Nocxr/Nocxr-patch-2

    SignatureHelper breaking on TArray fix
    Nocxr authored Sep 16, 2025
    Configuration menu
    Copy the full SHA
    d7c4295 View commit details
    Browse the repository at this point in the history
  3. Update README.md

    Nocxr authored Sep 16, 2025
    Configuration menu
    Copy the full SHA
    3f4051e View commit details
    Browse the repository at this point in the history
  4. Update README.md

    Nocxr authored Sep 16, 2025
    Configuration menu
    Copy the full SHA
    ceb5278 View commit details
    Browse the repository at this point in the history
  5. Update README.md

    Nocxr authored Sep 16, 2025
    Configuration menu
    Copy the full SHA
    eaaf275 View commit details
    Browse the repository at this point in the history
  6. Update README.md

    Nocxr authored Sep 16, 2025
    Configuration menu
    Copy the full SHA
    8322592 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2989d9a View commit details
    Browse the repository at this point in the history
Loading