dbertoni 01/09/11 14:03:15
Modified: c/src/XSLT StylesheetExecutionContext.cpp
Log:
Fix for bug 3544.
Revision Changes Path
1.10 +24 -8 xml-xalan/c/src/XSLT/StylesheetExecutionContext.cpp
Index: StylesheetExecutionContext.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContext.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- StylesheetExecutionContext.cpp 2001/07/08 18:48:40 1.9
+++ StylesheetExecutionContext.cpp 2001/09/11 21:03:15 1.10
@@ -88,28 +88,44 @@
m_executionContext(executionContext),
m_savedStackFrameIndex(executionContext.getCurrentStackFrameIndex())
{
+ // It would be cleaner to replace these two lines with separate
+ // subobjects, but that would means saving two more copies of
+ // the execution context on the stack. Instead, we're just using
+ // a catch block to make sure that the code in the destructor runs
+ // if there's a problem pushing the params.
executionContext.pushContextMarker();
executionContext.setCurrentStackFrameIndex(m_savedStackFrameIndex);
- if (xslCallTemplateElement.hasParams() == true)
+ try
{
- executionContext.pushParams(
- xslCallTemplateElement,
- sourceNode,
- targetTemplate);
+ if (xslCallTemplateElement.hasParams() == true)
+ {
+ executionContext.pushParams(
+ xslCallTemplateElement,
+ sourceNode,
+ targetTemplate);
+ }
+
+ executionContext.setCurrentStackFrameIndex();
}
+ catch(...)
+ {
+
m_executionContext.setCurrentStackFrameIndex(m_savedStackFrameIndex);
- executionContext.setCurrentStackFrameIndex();
+ m_executionContext.popContextMarker();
+
+ throw;
+ }
}
StylesheetExecutionContext::ParamsPushPop::~ParamsPushPop()
{
- m_executionContext.popContextMarker();
-
m_executionContext.setCurrentStackFrameIndex(m_savedStackFrameIndex);
+
+ m_executionContext.popContextMarker();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]