Permalink
Browse files

Fix crash creating backtrace for incorrectly invoked reified function

Summary:
If a reified function is called without reification, it raises an
error, but its 0ReifiedGenerics is Uninit.

Reviewed By: ricklavoie, oulgen

Differential Revision: D12826818

fbshipit-source-id: 06fcce623d9a0e8156d42f7585f467a7575c4be7
  • Loading branch information...
markw65 authored and hhvm-bot committed Oct 29, 2018
1 parent 4ffd01f commit 6c84461b054fc7f16a231ba197abe628bb38b395
Showing with 7 additions and 5 deletions.
  1. +7 −5 hphp/runtime/base/backtrace.cpp
@@ -385,13 +385,15 @@ Array createBacktrace(const BacktraceArgs& btArgs) {
}
if (RuntimeOption::EnableArgsInBacktraces &&
fp->func()->hasReifiedGenerics()) {
fp->func()->hasReifiedGenerics()) {
// First local is always $0ReifiedGenerics which comes right after params
auto const tv = frame_local(fp, fp->func()->numParams());
assertx(tv && (RuntimeOption::EvalHackArrDVArrs ? tvIsVec(tv)
: tvIsArray(tv)));
auto const reified_generics = tv->m_data.parr;
funcname += mangleReifiedGenericsName(reified_generics);
if (tv->m_type != KindOfUninit) {
assertx(tv && (RuntimeOption::EvalHackArrDVArrs ? tvIsVec(tv)
: tvIsArray(tv)));
auto const reified_generics = tv->m_data.parr;
funcname += mangleReifiedGenericsName(reified_generics);
}
}
frame.set(s_function, funcname);

0 comments on commit 6c84461

Please sign in to comment.