Changes between Initial Version and Version 1 of Ticket #12950, comment 1


Ignore:
Timestamp:
Sep 20, 2021, 11:55:53 AM (3 years ago)
Author:
antoniou79

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12950, comment 1

    initial v1  
    22Just writing "should" suffices to trigger the crash (segmentation fault).
    33
    4 Seems to occur because in this part of code (TTparser::considerRequests()), in this case, _conceptP is nullptr but there's no check for it. For some reason the execution seems to go into findByWordClass() and there "this" is treated as non-null which leads to segmentation fault.
     4Seems to occur because in this part of code (`TTparser::considerRequests()`), in this case, `_conceptP` is nullptr but there's no check for it. For some reason the execution seems to go into `findByWordClass()` and there `this` is treated as non-null which leads to segmentation fault.
    55
    66{{{
     
    99https://github.com/scummvm/scummvm/blob/dc1717067322bade8c43536679ece9a9b9a87b49/engines/titanic/true_talk/tt_parser.cpp#L1000
    1010
    11 Oddly, while debugging with Visual Studio, the execution goes into findByWordClass() but this is treated as null and the method returns nullptr.
     11Oddly, while debugging with Visual Studio, the execution goes into findByWordClass() but `this` is treated as null and the method returns nullptr.
    1212
    1313We could fix this by doing something like:
     
    1717}}}
    1818
    19 However, I can see multiple other instances in the same class, where we use _conceptP methods and members unchecked. Not sure if we should fix all the other cases too, or fix the reason why _conceptP is nullptr at that part of the code -- maybe the code wrongly assumes that it should have been initialized earlier or maybe it should have been initialized and it's not?
     19However, I can see multiple other instances in the same class, where we use `_conceptP` methods and members unchecked. Not sure if we should fix all the other cases too, or fix the reason why `_conceptP` is nullptr at that part of the code -- maybe the code wrongly assumes that it should have been initialized earlier or maybe it should have been initialized and it's not?