Skip to content

Commit

Permalink
Converted smart pointer for the rule context in RecognitionException
Browse files Browse the repository at this point in the history
Since we pass around raw pointer for volatile references now, we must not create smart pointers from them or we will get a double free.
  • Loading branch information
mike-lischke committed Oct 14, 2016
1 parent a4e3438 commit 014070d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/Cpp/runtime/src/RecognitionException.h
Expand Up @@ -45,7 +45,7 @@ namespace antlr4 {
/// The Recognizer where this exception originated.
IRecognizer *_recognizer;
IntStream *_input;
Ref<ParserRuleContext> _ctx;
ParserRuleContext *_ctx;

/// The current Token when an error occurred. Since not all streams
/// support accessing symbols by index, we have to track the Token
Expand Down Expand Up @@ -91,7 +91,7 @@ namespace antlr4 {
/// </summary>
/// <returns> The <seealso cref="RuleContext"/> at the time this exception was thrown.
/// If the context is not available, this method returns {@code null}. </returns>
virtual Ref<RuleContext> getCtx() const;
virtual RuleContext* getCtx() const;

/// <summary>
/// Gets the input stream which is the symbol source for the recognizer where
Expand Down

0 comments on commit 014070d

Please sign in to comment.