File: dangling_parser_parse_padstring.cpp

package info (click to toggle)
simdjson 4.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 31,400 kB
  • sloc: cpp: 195,760; ansic: 20,954; sh: 1,126; python: 885; makefile: 47; ruby: 25; javascript: 13
file content (16 lines) | stat: -rw-r--r-- 407 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

// this tests https://github.com/simdjson/simdjson/issues/696

#include <iostream>
#include "simdjson.h"

int main() {
    simdjson::padded_string buf;
#if COMPILATION_TEST_USE_FAILING_CODE
    simdjson::dom::element tree = simdjson::dom::parser().parse(buf);
#else
    simdjson::dom::parser parser;
    simdjson::dom::element tree = parser.parse(buf);
#endif
    std::cout << tree["type"] << std::endl;
}