x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Unreal, why doesn't the compiler compile the following several lines of code?

 void ACineActor::PrintPlayingAudioName()
 {
     ALevelSequenceActor* SequenceActor = GetOwningLevelSequenceActor();
     ULevelSequencePlayer* SequencePlayer = SequenceActor->SequencePlayer;
     if (SequencePlayer == nullptr || !SequencePlayer->IsPlaying())
     {
         UE_LOG(CineLog, Error, TEXT("SequencePlayer is null."));
         return;
     }
 
     TSharedRef<FMovieSceneSequenceInstance> movieSceneInstance = ((IMovieScenePlayer*)SequencePlayer)->GetRootMovieSceneSequenceInstance();
     TSharedPtr<FMovieSceneSequenceInstance> movieSceneInstancePtr = movieSceneInstance;
     UE_LOG(CineLog, Error, TEXT("asdf: %s"), *(movieSceneInstance->GetSequence()->GetName()));

     /************************ Here's the problem! *************************/
     // It seems that compiler hasnot compiled the following lines...
     void* pv = &movieSceneInstancePtr;
     unsigned char * pc = (unsigned char *)pv;
     FMovieSceneSequenceInstance* MovieSceneSequenceInstance_tmpPtr = (reinterpret_cast<FMovieSceneSequenceInstance*>(pc));
 
     TMap<FGuid, FMovieSceneObjectBindingInstanceMock>* ObjectBindingInstances = (TMap<FGuid, FMovieSceneObjectBindingInstanceMock>*) (MovieSceneSequenceInstance_tmpPtr + 78);
     UE_LOG(CineLog, Error, TEXT("alart: %d"), ObjectBindingInstances->GetAllocatedSize())
 }

When I debugged the game, I found the debugging yellow arrow just jumped over these lines, and then the engine crashed. Why?

Product Version: UE 4.14
Tags:
more ▼

asked Feb 17 '17 at 06:22 AM in C++ Programming

avatar image

Yunze Gu
63 16 18 20

avatar image Wurmloch83 Feb 17 '17 at 06:26 PM

The compiler will never leave lines of code "uncompiled", without an error message. It is likely that some lines have been optimezed out by the compiler. You can avoid this by using the Debug* Configurations instead of the Development* ones. What does the debugger say when the crash occurs?

avatar image ExtraLifeMatt Feb 17 '17 at 11:11 PM

Void pointer, reinterpret_cast, manual pointer arithmetic - this has crash written all over it.

What are you trying to do?

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Wurmloch83 is right and I can debug each line by his way. The reason why it crashed was that I manipulated the pointers in the wrong way. And I do this because I want to reach a hack destination, and it's that I want to know if a sequencer is playing the audio sections on it.

more ▼

answered Feb 20 '17 at 02:25 AM

avatar image

Yunze Gu
63 16 18 20

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question