Skip to content

Commit b80e5f4

Browse files
committed
Fixed traps handling
1 parent c28e7c0 commit b80e5f4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/common/cvt.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,7 +1725,7 @@ void CVT_move_common(const dsc* from, dsc* to, DecimalStatus decSt, Callbacks* c
17251725
intermediate.makeText(static_cast<USHORT>(strlen(text)), CS_ASCII,
17261726
reinterpret_cast<UCHAR*>(text));
17271727

1728-
CVT_move_common(&intermediate, to, 0, cb);
1728+
CVT_move_common(&intermediate, to, decSt, cb);
17291729
return;
17301730
}
17311731

@@ -1760,7 +1760,7 @@ void CVT_move_common(const dsc* from, dsc* to, DecimalStatus decSt, Callbacks* c
17601760

17611761
case dtype_short:
17621762
{
1763-
ULONG lval = CVT_get_long(from, (SSHORT) to->dsc_scale, 0, cb->err);
1763+
ULONG lval = CVT_get_long(from, (SSHORT) to->dsc_scale, decSt, cb->err);
17641764
// TMN: Here we should really have the following fb_assert
17651765
// fb_assert(lval <= MAX_SSHORT);
17661766
*(SSHORT*) p = (SSHORT) lval;
@@ -1770,11 +1770,11 @@ void CVT_move_common(const dsc* from, dsc* to, DecimalStatus decSt, Callbacks* c
17701770
return;
17711771

17721772
case dtype_long:
1773-
*(SLONG *) p = CVT_get_long(from, (SSHORT) to->dsc_scale, 0, cb->err);
1773+
*(SLONG *) p = CVT_get_long(from, (SSHORT) to->dsc_scale, decSt, cb->err);
17741774
return;
17751775

17761776
case dtype_int64:
1777-
*(SINT64 *) p = CVT_get_int64(from, (SSHORT) to->dsc_scale, 0, cb->err);
1777+
*(SINT64 *) p = CVT_get_int64(from, (SSHORT) to->dsc_scale, decSt, cb->err);
17781778
return;
17791779

17801780
case dtype_quad:
@@ -1784,12 +1784,12 @@ void CVT_move_common(const dsc* from, dsc* to, DecimalStatus decSt, Callbacks* c
17841784
((SLONG *) p)[1] = ((SLONG *) q)[1];
17851785
return;
17861786
}
1787-
*(SQUAD *) p = CVT_get_quad(from, (SSHORT) to->dsc_scale, 0, cb->err);
1787+
*(SQUAD *) p = CVT_get_quad(from, (SSHORT) to->dsc_scale, decSt, cb->err);
17881788
return;
17891789

17901790
case dtype_real:
17911791
{
1792-
double d_value = CVT_get_double(from, 0, cb->err);
1792+
double d_value = CVT_get_double(from, decSt, cb->err);
17931793
if (ABSOLUT(d_value) > FLOAT_MAX)
17941794
cb->err(Arg::Gds(isc_arith_except) << Arg::Gds(isc_numeric_out_of_range));
17951795
*(float*) p = (float) d_value;
@@ -1801,7 +1801,7 @@ void CVT_move_common(const dsc* from, dsc* to, DecimalStatus decSt, Callbacks* c
18011801
{
18021802
USHORT strtype_unused;
18031803
UCHAR* ptr;
1804-
USHORT len = CVT_get_string_ptr_common(from, &strtype_unused, &ptr, NULL, 0, 0, cb);
1804+
USHORT len = CVT_get_string_ptr_common(from, &strtype_unused, &ptr, NULL, 0, decSt, cb);
18051805

18061806
if (len == to->dsc_length)
18071807
{
@@ -2503,7 +2503,7 @@ Decimal64 CVT_get_dec64(const dsc* desc, DecimalStatus decSt, ErrorFunction err)
25032503
case dtype_varying:
25042504
case dtype_cstring:
25052505
case dtype_text:
2506-
CVT_make_string(desc, ttype_ascii, &p, &buffer, sizeof(buffer) - 1, 0, err);
2506+
CVT_make_string(desc, ttype_ascii, &p, &buffer, sizeof(buffer) - 1, decSt, err);
25072507
buffer.vary_string[buffer.vary_length] = 0;
25082508
return d64.set(buffer.vary_string, decSt);
25092509

@@ -2588,7 +2588,7 @@ Decimal128 CVT_get_dec128(const dsc* desc, DecimalStatus decSt, ErrorFunction er
25882588
case dtype_varying:
25892589
case dtype_cstring:
25902590
case dtype_text:
2591-
CVT_make_string(desc, ttype_ascii, &p, &buffer, sizeof(buffer) - 1, 0, err);
2591+
CVT_make_string(desc, ttype_ascii, &p, &buffer, sizeof(buffer) - 1, decSt, err);
25922592
buffer.vary_string[buffer.vary_length] = 0;
25932593
return d128.set(buffer.vary_string, decSt);
25942594

@@ -2680,7 +2680,7 @@ SQUAD CVT_get_quad(const dsc* desc, SSHORT scale, DecimalStatus decSt, ErrorFunc
26802680
case dtype_text:
26812681
{
26822682
USHORT length =
2683-
CVT_make_string(desc, ttype_ascii, &p, &buffer, sizeof(buffer), 0, err);
2683+
CVT_make_string(desc, ttype_ascii, &p, &buffer, sizeof(buffer), decSt, err);
26842684
scale -= CVT_decompose(p, length, dtype_quad, &value.gds_quad_high, err);
26852685
}
26862686
break;

0 commit comments

Comments
 (0)