Giter Club home page Giter Club logo

Comments (10)

tlively avatar tlively commented on June 9, 2024 1

I'm working on a fix, btw.

from binaryen.

tlively avatar tlively commented on June 9, 2024

It's valid WTF-8, but it's not valid UTF-8 because the first code point is a surrogate.

from binaryen.

kripken avatar kripken commented on June 9, 2024

Should we avoid emitting that in the fuzzer, then? Or if we do want to fuzz it, should we escape it somehow when printing the string?

from binaryen.

tlively avatar tlively commented on June 9, 2024

It would be good to escape it in the fuzz output, I think. In general it's important to be fuzzing with strings that are not valid unicode.

from binaryen.

kripken avatar kripken commented on June 9, 2024

I'm not sure how to fix this in the fuzzer specifically, because the fuzzer isn't able to read the output from wasm-opt --fuzz-exec. We could do it in the Literal printing logic for strings, which is what the fuzzer is reading, though I'm not sure if that would affect roundtripping - what do you think?

Btw I see this constantly now when I fuzz - several times a day at least. I'm reverting #6430 locally in order to be able to continue to fuzz for now.

from binaryen.

tlively avatar tlively commented on June 9, 2024

There's no way to round trip the fuzz exec output anyway, so I think any kind of escaping we can do both in C++ and in the JS fuzz wrapper should be fine, right?

from binaryen.

kripken avatar kripken commented on June 9, 2024

Fuzz exec output is just showing the output of printing a Literal. We do use the printed output of Literals in the text format as well, which we do need to roundtrip. Are you suggesting that --fuzz-exec mode should have custom printing code instead, something like that?

from binaryen.

tlively avatar tlively commented on June 9, 2024

For strings, at least, the way we print them in Print.cpp is unrelated to how we print them when they are Literals. We essentially already have that custom printing code.

from binaryen.

kripken avatar kripken commented on June 9, 2024

Am I misreading the code, then?

void visitConst(Const* curr) {
o << curr->value.type << ".const " << curr->value;
}

That does o << curr->value using a std::ostream and a Literal, so I think it uses the same Literal printing as --fuzz-exec, which is here:

std::cout << value << '\n';

?

from binaryen.

tlively avatar tlively commented on June 9, 2024

StringConst != Const!

from binaryen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.