From 535f0d0f0322f271d12d74418cd7ef394c834e2c Mon Sep 17 00:00:00 2001
From: ilor <kailoran@gmail.com>
Date: Thu, 21 Apr 2011 18:30:15 +0200
Subject: [PATCH] fix assertion failure in dyncast (match refactor)

---
 libwccl/ops/match/applyoperator.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libwccl/ops/match/applyoperator.cpp b/libwccl/ops/match/applyoperator.cpp
index a24ce26..9a5a987 100644
--- a/libwccl/ops/match/applyoperator.cpp
+++ b/libwccl/ops/match/applyoperator.cpp
@@ -20,8 +20,10 @@ ApplyOperator::ApplyOperator(
 
 void ApplyOperator::execute(const ActionExecContext &context) const
 {
-	boost::shared_ptr<MatchVector> matches =
-		boost::dynamic_pointer_cast<MatchVector>(context.variables()->get_fast(_matches));
+	MatchVector* matches =
+		dynamic_cast<MatchVector*>(
+			&context.variables()->get_fast(_matches)->get_value());
+	BOOST_ASSERT(matches);
 	context.sentence_context().goto_start();
 	while(context.sentence_context().is_current_inside()) {
 		int orig_pos = context.sentence_context().get_position();
-- 
GitLab