vmware-archive / go-pmem-transaction

Golang library for using persistent memory
Other
29 stars 5 forks source link

Fix crash when slice to be logged doesn't exist yet #29

Closed mohit10verma closed 5 years ago

mohit10verma commented 5 years ago

Fix for undoTx

pratapsu commented 5 years ago

Mohit:

What failed with this change? I mean, what regression test failed?

I'm wondering what caused an invalid value to show up here.

Pratap

mohit10verma commented 5 years ago

Hi Pratap,

You are right. This should never happen.

logSlice() is only called if v.Kind() == reflect.Slice. If indeed v.IsValid() is false, v.Kind() == reflect.Invalid.

I'll close this pull request.

For some reason I don't recall, I had this change in my list of changes when I modified go-redis. But it would never be executed.

Thanks for pointing it out!