Commit Graph

1833 Commits

Author SHA1 Message Date
Joakim Hove
51ce94cd62 Use range based for when iterating over RawRecords 2016-04-03 22:01:13 +02:00
Joakim Hove
e57d61468d Added non const record iterators to RawKeyword. 2016-04-03 22:00:30 +02:00
Joakim Hove
d604262355 Merge pull request #742 from chflo/parser_support_symlink
Parser support symlink
2016-04-01 19:14:55 +02:00
chflo
82bef27b8f Support symlink 2016-04-01 15:36:38 +02:00
chflo
8ee79e7be6 Support symlinks: Added test 2016-04-01 14:28:26 +02:00
Jørgen Kvalsvik
8e4e9b15d8 ReadValueToken correctly parses numbers
Changes the implementation of numbers parsing from std::atoi/f to
std::strtod/l. These support setting the optional end-of-string pointer
which are used to determine if a parsing was successful or not. This has
the nice side effect of *greatly* simplifying the logic, at the expense
of some C-style details.

Tests added to verify that the different edge cases are handled
properly.
2016-04-01 10:13:37 +02:00
Joakim Hove
63bfb550ff Merge pull request #737 from jokva/raw-keyword-record-std-list
RawKeyword iterator support and correct RawRecord management
2016-03-30 13:27:53 +02:00
Jørgen Kvalsvik
046afdd3be RawKeyword iterator support
Since RawRecords now has automatic storage, managed by std::list,
offering iterators is feasible. The random access
RawKeyword::getRecord's real use was accessing the records in order,
which now is handled via iterators.
2016-03-30 12:47:33 +02:00
Jørgen Kvalsvik
83ae276d67 Fix string_view iterator invalidation bug
By changing the underlying storage of RawKeyword to std::list, we ensure
that the RawRecords aren't reallocated and moved, preserving the
validity of string_view's. This changes the access complexity of
RawRecord from O(1) to O(n).
2016-03-30 12:31:00 +02:00
Atgeirr Flø Rasmussen
8031ba9d56 Silence unused argument warning. 2016-03-29 21:22:08 +02:00
Atgeirr Flø Rasmussen
edfe69f639 Add missing include directives. 2016-03-29 21:21:43 +02:00
Joakim Hove
b778beb507 Renamed enum symbols 2016-03-29 14:18:03 +02:00
Joakim Hove
4810b09c13 Merge pull request #731 from qilicun/add-msgcontainer-to-parsecontext
add member and functions.
2016-03-29 12:38:22 +02:00
Joakim Hove
7bd2707307 Merge pull request #730 from joakim-hove/first-output-step
First output step
2016-03-29 12:36:54 +02:00
Liu Ming
bf361cce86 add member and functions. 2016-03-29 15:19:43 +08:00
Joakim Hove
92ba3df9ab Merge pull request #729 from qilicun/add_message_container
Add message container
2016-03-29 08:49:49 +02:00
Liu Ming
1f44ade6c7 Add range based test. 2016-03-29 10:21:10 +08:00
Joakim Hove
b0a12b230e Internalize first output step for restart and RFT. 2016-03-28 18:47:30 +02:00
Joakim Hove
b91c6fdbf3 Added find() method to DynamicState 2016-03-28 18:47:29 +02:00
Liu Ming
aea8d7a5bf test iterator. 2016-03-28 08:52:56 +08:00
Liu Ming
a778f4b225 remove deleted file from cmake list. 2016-03-25 16:14:34 +08:00
Liu Ming
9828cdc1d9 fix copy right. 2016-03-25 11:21:43 +08:00
Liu Ming
b53d0909ba add tests for message container. 2016-03-25 10:55:22 +08:00
Liu Ming
82863ac090 add begin(), end() iterator function. 2016-03-25 09:52:27 +08:00
Liu Ming
6f3d8b0e07 move MessageType definition. add overload functions. 2016-03-25 09:47:57 +08:00
Liu Ming
2865f96eda Add message container. 2016-03-24 13:55:12 +08:00
Joakim Hove
1491898706 Merge pull request #728 from jokva/various-improvements
Various improvements
2016-03-23 16:55:39 +01:00
Jørgen Kvalsvik
9e76ec5f78 Inline hot-but-trivial functions
These functions are called a lot and are trivial accessors to the
underlying containers. By opening them for inlining we get a decent
performance benefit "for free" via optimisation opportunities.
2016-03-22 14:45:17 +01:00
Joakim Hove
d1652ef6ba Allow 'WAT' when parsing type string in WCONINJE. 2016-03-22 10:32:00 +01:00
Jørgen Kvalsvik
0da5cadc75 RawRecords auto store, strings moved to RawRecord
The accumulated strings are moved into RawRecords, which reduces
execution time (rough measurements indicates 4-8%). To facilitate this,
RawRecords are stored directly in the vector in favour of via
shared_ptrs.
2016-03-22 08:58:48 +01:00
Jørgen Kvalsvik
e64d9f82a4 DeckItem tag explicit instead of vtable lookup
dynamic_cast turns out to be rather slow, and it is faster to look up an
explicit tag instead.
2016-03-22 08:58:48 +01:00
chflo
f2ed1ba7ea Moved OpmLog from opm-parser to opm-common 2016-03-21 22:07:49 +01:00
Joakim Hove
a49f6ca00c Merge pull request #695 from jokva/refactor-grid-property-intializers
Refactor grid property intialisers
2016-03-21 21:33:39 +01:00
Liu Ming
c42d9ed77e fix header guard. 2016-03-21 15:24:48 +08:00
Joakim Hove
f0158f6ca3 Merge pull request #718 from jokva/fix-uninitialised-values
Initialisation and memory errors fixed
2016-03-17 13:56:48 +01:00
Liu Ming
33da3caa6e should be parse_context 2016-03-17 15:36:12 +08:00
Liu Ming
a164776b12 should be parse_context. 2016-03-17 15:22:36 +08:00
Liu Ming
fd4451a215 change sub folder name. 2016-03-17 15:00:11 +08:00
Liu Ming
15b818de24 fix renaming issue. 2016-03-17 14:50:00 +08:00
Liu Ming
25acd89325 rename the last files. 2016-03-17 08:42:46 +08:00
Liu Ming
1fe83c9a78 rename ParseMode as ParseContext in python folder. 2016-03-17 08:34:48 +08:00
Liu Ming
6e542cb083 rename ParseMode as ParseContext in Units folder. 2016-03-17 08:29:32 +08:00
Liu Ming
88d489e876 rename ParseMode as ParseContext in IntegrationTests folder. 2016-03-17 08:28:17 +08:00
Liu Ming
a4a449538d rename ParseMode as ParseContext in EclipseState folder. 2016-03-16 17:15:09 +08:00
Liu Ming
12268c7937 rename ParseMode as ParseContext in Deck folder. 2016-03-16 16:36:34 +08:00
Liu Ming
705a9dc168 rename ParseMode as ParseContex in Parser folder. 2016-03-16 16:34:58 +08:00
Liu Ming
88c89b707d rename ParseMode class as ParseContext. 2016-03-16 16:24:59 +08:00
Jørgen Kvalsvik
aa064a9050 Fix buffer overflow vulnerability
An attacker using very long decimal integers as input could trigger a
buffer overflow write during int/double parsing.

The vulnerability has been fixed and raw buffer boundaries are checked.
Additionally, integer buffer size is determined by platform 'int' width.
'double' uses a heuristic to support both pure decimal formats (up to 64
characters long) and float formats.
2016-03-15 16:42:02 +01:00
Jørgen Kvalsvik
23f01511bd Add string_view::empty() 2016-03-15 16:42:02 +01:00
Jørgen Kvalsvik
47ca6d31cc Remove unused dropParserKeyword
This method is not used at all, but creates noise in tests and is broken
(iterator invalidation).
2016-03-15 15:14:10 +01:00