Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arpad Lovassy
titan.core
Commits
30ee7e1d
Commit
30ee7e1d
authored
Oct 12, 2017
by
Botond Baranyi
Committed by
Gerrit Code Review
Oct 12, 2017
Browse files
Merge "OER regression test fixes"
parents
3fbc089c
014b3866
Changes
3
Hide whitespace changes
Inline
Side-by-side
compiler2/Type_chk.cc
View file @
30ee7e1d
...
...
@@ -3004,45 +3004,50 @@ void Type::chk_oer() {
break
;
case
T_INT_A
:
{
if
(
is_constrained
())
{
Location
loc
;
int_limit_t
upper
=
get_sub_type
()
->
get_root
()
->
get_int_limit
(
true
,
&
loc
);
int_limit_t
lower
=
get_sub_type
()
->
get_root
()
->
get_int_limit
(
false
,
&
loc
);
bool
lower_inf
=
lower
.
get_type
()
!=
int_limit_t
::
NUMBER
;
bool
upper_inf
=
upper
.
get_type
()
!=
int_limit_t
::
NUMBER
;
if
(
lower_inf
||
upper_inf
)
{
oerattrib
->
signed_
=
lower_inf
;
oerattrib
->
bytes
=
-
1
;
}
else
{
int_val_t
low
=
lower
.
get_value
();
int_val_t
up
=
upper
.
get_value
();
if
(
low
<
0
)
{
oerattrib
->
signed_
=
true
;
if
(
low
>=
-
128
&&
up
<=
127
)
{
oerattrib
->
bytes
=
1
;
}
else
if
(
low
>=
-
32768
&&
up
<=
32767
)
{
oerattrib
->
bytes
=
2
;
}
else
if
(
low
>=
-
2147483648
&&
up
<=
2147483647
)
{
oerattrib
->
bytes
=
4
;
}
else
if
((
low
+
1
)
>=
-
9223372036854775807LL
&&
up
<=
9223372036854775807LL
)
{
oerattrib
->
bytes
=
8
;
}
else
{
oerattrib
->
bytes
=
-
1
;
}
if
(
get_sub_type
()
->
is_integer_subtype_notempty
())
{
Location
loc
;
int_limit_t
upper
=
get_sub_type
()
->
get_int_limit
(
true
,
&
loc
);
int_limit_t
lower
=
get_sub_type
()
->
get_int_limit
(
false
,
&
loc
);
bool
lower_inf
=
lower
.
get_type
()
!=
int_limit_t
::
NUMBER
;
bool
upper_inf
=
upper
.
get_type
()
!=
int_limit_t
::
NUMBER
;
if
(
lower_inf
||
upper_inf
)
{
oerattrib
->
signed_
=
lower_inf
;
oerattrib
->
bytes
=
-
1
;
}
else
{
static
int_val_t
uns_8_byte
(
"18446744073709551615"
,
NULL
);
oerattrib
->
signed_
=
false
;
if
(
up
<=
255
)
{
oerattrib
->
bytes
=
1
;
}
else
if
(
up
<=
65535
)
{
oerattrib
->
bytes
=
2
;
}
else
if
(
up
<=
4294967295
)
{
oerattrib
->
bytes
=
4
;
}
else
if
(
up
<=
uns_8_byte
)
{
oerattrib
->
bytes
=
8
;
int_val_t
low
=
lower
.
get_value
();
int_val_t
up
=
upper
.
get_value
();
if
(
low
<
0
)
{
oerattrib
->
signed_
=
true
;
if
(
low
>=
-
128
&&
up
<=
127
)
{
oerattrib
->
bytes
=
1
;
}
else
if
(
low
>=
-
32768
&&
up
<=
32767
)
{
oerattrib
->
bytes
=
2
;
}
else
if
(
low
>=
-
2147483648LL
&&
up
<=
2147483647
)
{
oerattrib
->
bytes
=
4
;
}
else
if
((
low
+
1
)
>=
-
9223372036854775807LL
&&
up
<=
9223372036854775807LL
)
{
oerattrib
->
bytes
=
8
;
}
else
{
oerattrib
->
bytes
=
-
1
;
}
}
else
{
oerattrib
->
bytes
=
-
1
;
static
int_val_t
uns_8_byte
(
"18446744073709551615"
,
NULL
);
oerattrib
->
signed_
=
false
;
if
(
up
<=
255
)
{
oerattrib
->
bytes
=
1
;
}
else
if
(
up
<=
65535
)
{
oerattrib
->
bytes
=
2
;
}
else
if
(
up
<=
4294967295LL
)
{
oerattrib
->
bytes
=
4
;
}
else
if
(
up
<=
uns_8_byte
)
{
oerattrib
->
bytes
=
8
;
}
else
{
oerattrib
->
bytes
=
-
1
;
}
}
}
}
else
{
oerattrib
->
signed_
=
true
;
oerattrib
->
bytes
=
-
1
;
}
}
else
{
oerattrib
->
signed_
=
true
;
...
...
compiler2/subtype.hh
View file @
30ee7e1d
...
...
@@ -218,6 +218,8 @@ public:
bool
is_length_compatible
(
const
SubtypeConstraint
*
p_st
)
const
;
bool
is_upper_limit_infinity
()
const
;
bool
is_lower_limit_infinity
()
const
;
bool
is_integer_subtype_notempty
()
const
{
return
subtype
==
ST_INTEGER
&&
integer_st
&&
!
integer_st
->
is_empty
();
}
};
/**
...
...
compiler2/ttcn3/Attributes.cc
View file @
30ee7e1d
...
...
@@ -666,8 +666,8 @@ namespace Ttcn {
(
type
->
has_encoding
(
Type
::
CT_RAW
)
&&
ti_type
->
has_encoding
(
Type
::
CT_RAW
))
||
(
type
->
has_encoding
(
Type
::
CT_TEXT
)
&&
ti_type
->
has_encoding
(
Type
::
CT_TEXT
))
||
(
type
->
has_encoding
(
Type
::
CT_XER
)
&&
ti_type
->
has_encoding
(
Type
::
CT_XER
))
||
(
type
->
has_encoding
(
Type
::
CT_JSON
)
&&
ti_type
->
has_encoding
(
Type
::
CT_JSON
))
)
||
(
type
->
has_encoding
(
Type
::
CT_OER
)
&&
ti_type
->
has_encoding
(
Type
::
CT_OER
)))
{
(
type
->
has_encoding
(
Type
::
CT_JSON
)
&&
ti_type
->
has_encoding
(
Type
::
CT_JSON
))
||
(
type
->
has_encoding
(
Type
::
CT_OER
)
&&
ti_type
->
has_encoding
(
Type
::
CT_OER
)))
)
{
act_attr
->
error
(
"Type `%s' and type `%s' have no common encoding"
,
ti_type
->
get_typename
().
c_str
(),
type
->
get_typename
().
c_str
());
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment