diff options
| author | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2016-07-26 17:26:44 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2016-07-26 17:26:44 -0400 |
| commit | 59426c41c37bb09b66f1153a0f0c0e96c1db459b (patch) | |
| tree | 90b2e10f61949ec71e55c0556ed7204ea9825747 | |
| parent | d3c91158116fc3c5189d38ebf92de07bda44998b (diff) | |
| download | pyisda-59426c41c37bb09b66f1153a0f0c0e96c1db459b.tar.gz | |
add test to prevent segfault
| -rw-r--r-- | pyisda/curve.pyx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pyisda/curve.pyx b/pyisda/curve.pyx index 6ceee57..f33db25 100644 --- a/pyisda/curve.pyx +++ b/pyisda/curve.pyx @@ -183,11 +183,13 @@ cdef class SpreadCurve(Curve): cdef TDate* end_dates_c = <TDate*>malloc(len(end_dates) * sizeof(TDate)) self._thisptr = NULL cdef size_t i - + if cash_settle_date < yc.inspect()['base_date']: + raise ValueError("cash_settle_date: {0} is anterior to yc's base_date: {1}". + format(cash_settle_date, yc.inspect()['base_date'])) for i, d in enumerate(end_dates): end_dates_c[i] = pydate_to_TDate(d) - cdef TStubMethod stub_type + cdef TStubMethod stub_type if JpmcdsStringToStubMethod(b"f/s", &stub_type) != 0: raise ValueError("can't convert stub") |
