dougluce / marisa-trie

Automatically exported from code.google.com/p/marisa-trie
Other
0 stars 0 forks source link

Mapper Constructor' mistake #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. save a marisa-dict using save function
2. open the dictfile and read all info into a buffer
3. call map function

What is the expected output? What do you see instead?

map ok! see a exception instead.

What version of the product are you using? On what operating system?

marisa-0.1.4, Win7

Please provide any additional information below.

itseems something was wrong when I used map function:

and I found that in constructor:

Mapper::Mapper(const void *ptr, std::size_t size)
    : ptr_(ptr), origin_(NULL), avail_(size), size_(0),
      file_(NULL), map_(NULL) {
  MARISA_THROW_IF((ptr != NULL) && (size != 0), MARISA_PARAM_ERROR);
}

it should be (ptr == NULL) when throw exception, i also checked the newest beta 
version and that was ok.

Original issue reported on code.google.com by chuangwu...@gmail.com on 30 Sep 2011 at 9:21

GoogleCodeExporter commented 8 years ago
Thank you for your helpful report!

I've confirmed the problem.
It's my mistake.

A fixed version (maybe numbered 0.1.5) will be uploaded in the next few days.

Original comment by susumu.y...@gmail.com on 1 Oct 2011 at 12:43

GoogleCodeExporter commented 8 years ago
The problem is fixed in marisa-0.1.5.

Thank you again.

Original comment by susumu.y...@gmail.com on 4 Oct 2011 at 5:39